Skip to content

Commit e46bff2

Browse files
Arjan WaardenburgArjan Waardenburg
authored andcommitted
Set correct command in database
1 parent 1fbc7bb commit e46bff2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hardware/PhilipsHue.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ void CPhilipsHue::InsertUpdateSwitch(const int NodeID, const _eHueLightType LTyp
375375
//Update state for sValue, use Limitless_SetRGBColour ?
376376
int nvalue = atoi(result[0][0].c_str());
377377
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);
380380
if (bIsOn == tIsOn) //Check if the light was switched
381381
return;
382382
}
@@ -464,8 +464,8 @@ void CPhilipsHue::InsertUpdateSwitch(const int NodeID, const _eHueLightType LTyp
464464
//Update state
465465
int nvalue = atoi(result[0][0].c_str());
466466
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);
469469
if (bIsOn == tIsOn) //Check if the light was switched
470470
return;
471471
}

0 commit comments

Comments
 (0)