mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
Critical AC fix
Some additional commands compatibility for generic driver
This commit is contained in:
@@ -496,7 +496,12 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
|
||||
}
|
||||
|
||||
if (driver) return driver->Ctrl(cmd, n, Parameters, send, suffixCode, subItem);
|
||||
if (driver)
|
||||
{
|
||||
int res = driver->Ctrl(cmd, n, Parameters, send, suffixCode, subItem);
|
||||
setCmd(cmd);
|
||||
return res;
|
||||
}
|
||||
// Legacy code
|
||||
bool toExecute = (chActive>0); //if channel is already active - unconditionally propogate changes
|
||||
switch (cmd) {
|
||||
|
||||
@@ -250,11 +250,11 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
||||
switch(suffixCode)
|
||||
{
|
||||
case S_SET:
|
||||
set_tmp = Parameters[0]-16;
|
||||
if (set_tmp >= 0 && set_tmp <= 30)
|
||||
set_tmp = Parameters[0];
|
||||
if (set_tmp >= 10 && set_tmp <= 30)
|
||||
{
|
||||
data[B_SET_TMP] = set_tmp;
|
||||
if (send) publishTopic(item->itemArr->name,(long)Parameters[0],"/set");
|
||||
data[B_SET_TMP] = set_tmp -16;
|
||||
if (send) publishTopic(item->itemArr->name,(long) set_tmp,"/set");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -263,6 +263,7 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
||||
switch (cmd)
|
||||
{
|
||||
case CMD_ON:
|
||||
case CMD_XON:
|
||||
data[B_POWER] |= 1;
|
||||
SendData(on, sizeof(on)/sizeof(byte));
|
||||
if (send) publishTopic(item->itemArr->name,"ON","/cmd");
|
||||
|
||||
Reference in New Issue
Block a user