mirror of https://github.com/arendst/Tasmota.git
Better test for bulbtype
This commit is contained in:
parent
4749222d95
commit
f9d6ab1825
|
@ -1007,7 +1007,7 @@ String Z_Devices::dump(uint32_t dump_mode, uint16_t status_shortaddr) const {
|
|||
if (device.modelId) {
|
||||
dev[F(D_JSON_MODEL D_JSON_ID)] = device.modelId;
|
||||
}
|
||||
if (-1 != device.bulbtype) {
|
||||
if (device.bulbtype >= 0) {
|
||||
dev[F(D_JSON_ZIGBEE_LIGHT)] = device.bulbtype; // sign extend, 0xFF changed as -1
|
||||
}
|
||||
if (device.manufacturerId) {
|
||||
|
|
|
@ -756,7 +756,8 @@ void CmndZbLight(void) {
|
|||
|
||||
if (p) {
|
||||
int8_t bulbtype = strtol(p, nullptr, 10);
|
||||
if (bulbtype > 5) { bulbtype = 5; }
|
||||
if (bulbtype > 5) { bulbtype = 5; }
|
||||
if (bulbtype < -1) { bulbtype = -1; }
|
||||
zigbee_devices.setHueBulbtype(shortaddr, bulbtype);
|
||||
}
|
||||
String dump = zigbee_devices.dumpLightState(shortaddr);
|
||||
|
|
Loading…
Reference in New Issue