Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
bombcheck committed Oct 26, 2018
2 parents 5b230c4 + 5348912 commit 75a2cd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/MiLight/CctPacketFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void CctPacketFormatter::finalizePacket(uint8_t* packet) {

void CctPacketFormatter::updateBrightness(uint8_t value) {
const GroupState* state = this->stateStore->get(deviceId, groupId, MiLightRemoteType::REMOTE_TYPE_CCT);
int8_t knownValue = state->isSetBrightness() ? state->getBrightness() : -1;
int8_t knownValue = (state != NULL && state->isSetBrightness()) ? state->getBrightness() : -1;

valueByStepFunction(
&PacketFormatter::increaseBrightness,
Expand All @@ -62,7 +62,7 @@ void CctPacketFormatter::updateBrightness(uint8_t value) {

void CctPacketFormatter::updateTemperature(uint8_t value) {
const GroupState* state = this->stateStore->get(deviceId, groupId, MiLightRemoteType::REMOTE_TYPE_CCT);
int8_t knownValue = state->isSetKelvin() ? state->getKelvin() : -1;
int8_t knownValue = (state != NULL && state->isSetKelvin()) ? state->getKelvin() : -1;

valueByStepFunction(
&PacketFormatter::increaseTemperature,
Expand Down

0 comments on commit 75a2cd0

Please sign in to comment.