mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 19:59:50 +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
|
// Legacy code
|
||||||
bool toExecute = (chActive>0); //if channel is already active - unconditionally propogate changes
|
bool toExecute = (chActive>0); //if channel is already active - unconditionally propogate changes
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|||||||
@@ -250,11 +250,11 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
|||||||
switch(suffixCode)
|
switch(suffixCode)
|
||||||
{
|
{
|
||||||
case S_SET:
|
case S_SET:
|
||||||
set_tmp = Parameters[0]-16;
|
set_tmp = Parameters[0];
|
||||||
if (set_tmp >= 0 && set_tmp <= 30)
|
if (set_tmp >= 10 && set_tmp <= 30)
|
||||||
{
|
{
|
||||||
data[B_SET_TMP] = set_tmp;
|
data[B_SET_TMP] = set_tmp -16;
|
||||||
if (send) publishTopic(item->itemArr->name,(long)Parameters[0],"/set");
|
if (send) publishTopic(item->itemArr->name,(long) set_tmp,"/set");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -263,6 +263,7 @@ int out_AC::Ctrl(short cmd, short n, int * Parameters, boolean send, int suffixC
|
|||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case CMD_ON:
|
case CMD_ON:
|
||||||
|
case CMD_XON:
|
||||||
data[B_POWER] |= 1;
|
data[B_POWER] |= 1;
|
||||||
SendData(on, sizeof(on)/sizeof(byte));
|
SendData(on, sizeof(on)/sizeof(byte));
|
||||||
if (send) publishTopic(item->itemArr->name,"ON","/cmd");
|
if (send) publishTopic(item->itemArr->name,"ON","/cmd");
|
||||||
|
|||||||
Reference in New Issue
Block a user