File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ void CctPacketFormatter::finalizePacket(uint8_t* packet) {
4949
5050void CctPacketFormatter::updateBrightness (uint8_t value) {
5151 const GroupState* state = this ->stateStore ->get (deviceId, groupId, MiLightRemoteType::REMOTE_TYPE_CCT);
52- int8_t knownValue = state->isSetBrightness () ? state->getBrightness () : -1 ;
52+ int8_t knownValue = ( state != NULL && state ->isSetBrightness () ) ? state->getBrightness () : -1 ;
5353
5454 valueByStepFunction (
5555 &PacketFormatter::increaseBrightness,
@@ -62,7 +62,7 @@ void CctPacketFormatter::updateBrightness(uint8_t value) {
6262
6363void CctPacketFormatter::updateTemperature (uint8_t value) {
6464 const GroupState* state = this ->stateStore ->get (deviceId, groupId, MiLightRemoteType::REMOTE_TYPE_CCT);
65- int8_t knownValue = state->isSetKelvin () ? state->getKelvin () : -1 ;
65+ int8_t knownValue = ( state != NULL && state ->isSetKelvin () ) ? state->getKelvin () : -1 ;
6666
6767 valueByStepFunction (
6868 &PacketFormatter::increaseTemperature,
You can’t perform that action at this time.
0 commit comments