@@ -375,8 +375,8 @@ void CPhilipsHue::InsertUpdateSwitch(const int NodeID, const _eHueLightType LTyp
375
375
// Update state for sValue, use Limitless_SetRGBColour ?
376
376
int nvalue = atoi (result[0 ][0 ].c_str ());
377
377
bool tIsOn = (nvalue != 0 );
378
- m_sql.safe_query (" UPDATE DeviceStatus SET sValue='%q', LastLevel = %d WHERE(HardwareID == %d) AND (DeviceID == '%q')" ,
379
- szSValue, BrightnessLevel, m_HwdID, szID);
378
+ m_sql.safe_query (" UPDATE DeviceStatus SET nValue=%d, sValue='%q', LastLevel = %d WHERE(HardwareID == %d) AND (DeviceID == '%q')" ,
379
+ int (cmd), szSValue, BrightnessLevel, m_HwdID, szID);
380
380
if (bIsOn == tIsOn) // Check if the light was switched
381
381
return ;
382
382
}
@@ -464,8 +464,8 @@ void CPhilipsHue::InsertUpdateSwitch(const int NodeID, const _eHueLightType LTyp
464
464
// Update state
465
465
int nvalue = atoi (result[0 ][0 ].c_str ());
466
466
bool tIsOn = (nvalue != 0 );
467
- m_sql.safe_query (" UPDATE DeviceStatus SET LastLevel=%d, sValue='%q' WHERE (HardwareID==%d) AND (DeviceID=='%q')" ,
468
- BrightnessLevel, szLevel, m_HwdID, szID);
467
+ m_sql.safe_query (" UPDATE DeviceStatus SET LastLevel=%d, nValue=%d, sValue='%q' WHERE (HardwareID==%d) AND (DeviceID=='%q')" ,
468
+ BrightnessLevel, int (cmd), szLevel, m_HwdID, szID);
469
469
if (bIsOn == tIsOn) // Check if the light was switched
470
470
return ;
471
471
}
0 commit comments