mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 03:39:49 +03:00
Fake "alarm off" event for legacy thermostat fixed
scheduled execution fixed Aircon driver relability improvement (working on 1-way lines)
This commit is contained in:
@@ -1094,7 +1094,8 @@ int Item::Ctrl(itemCmd cmd, char* subItem, uint8_t flags, bool authorized)
|
||||
}
|
||||
///
|
||||
|
||||
if (((flags & CTRL_SCHEDULED_CALL_RECURSION) == CTRL_SCHEDULED_CALL_RECURSION && itemType != CH_GROUP))
|
||||
if (((flags & CTRL_SCHEDULED_CALL_RECURSION) == CTRL_SCHEDULED_CALL_RECURSION && itemType == CH_GROUP))
|
||||
// if (((flags & CTRL_SCHEDULED_CALL_RECURSION) == CTRL_SCHEDULED_CALL_RECURSION && itemType != CH_GROUP))
|
||||
{
|
||||
debugSerial<<F("Skipping scheduled group exec")<<endl;
|
||||
return -7;
|
||||
@@ -1686,7 +1687,7 @@ if ((!driver || driver->isAllowed(cmd))
|
||||
#endif
|
||||
}
|
||||
tStore.tempX100=cmd.getFloat()*100.; //Save measurement
|
||||
tStore.timestamp16=millisNZ(8) & 0xFFFFU; //And timestamp
|
||||
tStore.timestamp16=millisNZ(8,0xFFFFU); //And timestamp
|
||||
debugSerial<<F("THERM:")<<itemArr->name<<F(" T:")<<tStore.tempX100<<F(" TS:")<<tStore.timestamp16<<endl;
|
||||
setExt(tStore.asint);
|
||||
res=1;
|
||||
|
||||
@@ -3282,7 +3282,7 @@ publishStat();
|
||||
|
||||
if (tStore.timestamp16) //Valid temperature
|
||||
{
|
||||
if (isTimeOver(tStore.timestamp16,millisNZ(8) & 0xFFFF,PERIOD_THERMOSTAT_FAILED >> 8,0xFFFF))
|
||||
if (isTimeOver(tStore.timestamp16,millisNZ(8,0xFFFF),PERIOD_THERMOSTAT_FAILED >> 8,0xFFFF))
|
||||
{
|
||||
errorSerial<<thermoItem->name<<F(" Alarm Expired\n");
|
||||
#if not defined (NOIP)
|
||||
|
||||
@@ -326,6 +326,9 @@ if (!store)
|
||||
return 0;}
|
||||
|
||||
memset(store->data,0,sizeof(acPersistent::data));
|
||||
store->data[0]=255;
|
||||
store->data[1]=255;
|
||||
store->data[2]=0x22;
|
||||
store->mode=0;
|
||||
store->power=0;
|
||||
store->inCheck=0;
|
||||
|
||||
@@ -839,9 +839,9 @@ itemCmd mapInt(int32_t arg, aJsonObject* map)
|
||||
}
|
||||
|
||||
//Same as millis() but never return 0 or -1
|
||||
uint32_t millisNZ(uint8_t shift)
|
||||
uint32_t millisNZ(uint8_t shift, uint32_t mask)
|
||||
{
|
||||
uint32_t now = millis()>>shift;
|
||||
uint32_t now = (millis()>>shift) & mask;
|
||||
if (!now || !(now+1)) now=1;
|
||||
return now;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ bool isTimeOver(uint32_t timestamp, uint32_t currTime, uint32_t time, uint32_t m
|
||||
bool executeCommand(aJsonObject* cmd, int8_t toggle = -1);
|
||||
bool executeCommand(aJsonObject* cmd, int8_t toggle, itemCmd _itemCmd, aJsonObject* defaultItem=NULL, aJsonObject* defaultEmit=NULL, aJsonObject* defaultCan = NULL);
|
||||
itemCmd mapInt(int32_t arg, aJsonObject* map);
|
||||
uint32_t millisNZ(uint8_t shift=0);
|
||||
uint32_t millisNZ(uint8_t shift=0, uint32_t mask=0xFFFFFFFFUL);
|
||||
serialParamType str2SerialParam(char * str);
|
||||
String toString(const IPAddress& address);
|
||||
bool getPinVal(uint8_t pin);
|
||||
|
||||
Reference in New Issue
Block a user