Skip to content

Commit

Permalink
Universal remote fixes & enhancemements
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Jun 10, 2024
1 parent 08fdf21 commit cf758fe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 1 addition & 5 deletions core/class/AbeilleCmdProcess.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5128,22 +5128,18 @@ function processCmd($Command) {

// Generic way to support private cluster/cmd
// Mandatory params: 'addr', 'ep', 'fct'
// Optional: anything. The command is passed to function as it is.
else if ($cmdName == 'cmd-Private') {
// $required = ['addr', 'ep', 'fct', 'cmd', 'message']; // Mandatory infos
$required = ['addr', 'ep', 'fct']; // Mandatory infos
if (!$this->checkRequiredParams($required, $Command))
return;

$addr = $Command['addr'];
$ep = $Command['ep'];
$fctName = $Command['fct'];
// $cmd = $Command['cmd'];
// $message = $Command['message'];
if (function_exists($fctName)) {
// $fctName($dest, $addr, $ep, $cmd, $message);
$fctName($dest, $addr, $ep, $Command);
} else if (method_exists($this, $fctName)) {
// $this->$fctName($dest, $addr, $ep, $cmd, $message);
$this->$fctName($dest, $addr, $ep, $Command);
} else {
cmdLog2('error', $addr, " Commande privée: Fonction '${fctName}' inconnue");
Expand Down
2 changes: 1 addition & 1 deletion core/config/Abeille.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$abQueues["parserToRoutes"] = array( "id" => 0xE2, "max" => 2048 );
$abQueues["parserToCli"] = array( "id" => 0x2D4, "max" => 1024 );
$abQueues["parserToCmdAck"] = array( "id" => 0x3E7, "max" => 512 ); // Parser to cmd for 8000/8012/8702 statuses
$abQueues["xToCmd"] = array( "id" => 0x4BC, "max" => 512 ); // AbeilleCmd inputs
$abQueues["xToCmd"] = array( "id" => 0x4BC, "max" => 1024 ); // AbeilleCmd inputs
$abQueues["cmdToMon"] = array( "id" => 0x82, "max" => 512 ); // Messages to zigate (cmd to monitor)
$abQueues["parserToMon"] = array( "id" => 0x83, "max" => 1024 ); // Messages from zigate (parser to monitor)
$abQueues["monToCmd"] = array( "id" => 0x84, "max" => 1024 ); // Messages to cmd (addr update)
Expand Down
10 changes: 7 additions & 3 deletions core/php/AbeilleCmd-Tuya.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,17 @@ function tuyaZosungCrc($message) {
}

// Use cases: ED00 cluster support (Moes universal remote)
// Cmd 00: 'data'=IR code to send (base64 URL encoded format)
// Cmd 03: 'data'=JSON encoded {'seq' => hex string, 'pos' => binary, 'maxLen' => binary}
// Cmd 00: 'message'=IR code to send (base64 URL encoded format)
// Cmd 03: 'message'=JSON encoded {'seq' => hex string, 'pos' => binary, 'maxLen' => binary}
function tuyaZosung($net, $addr, $ep, $command) {
$cmd = $command['cmd'];
$data = $command['data'];
cmdLog2('debug', $addr, " tuyaZosung(Net=${net}, Addr=${addr}, EP=${ep}, Cmd=${cmd})");

if (!isset($command['message'])) {
cmdLog2('error', $addr, "tuyaZosung: 'message' manquant");
return;
}
$data = $command['message'];
if ($cmd == '00') { // Send IR code
// Data is base64 URL encoded
$dataB64 = AbeilleTools::base64url2base64($data);
Expand Down
2 changes: 2 additions & 0 deletions docs/fr_FR/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- GL-C-007P, GLEDOPTO: Modèle revu.
- Support: Fichiers JSON réseau ajoutés au package de logs.
- Placement réseau: Améliorations & corrections analyse réseau.
- Interne: Cmd: Taille queue 'xToCmd' augmentée à 1024.
- Support Moes UFO-R11: Correction regression.

## 240519-BETA-1

Expand Down

0 comments on commit cf758fe

Please sign in to comment.