From 825f72cb51618770d428594a755a46641cad9a64 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 14 Nov 2020 11:23:43 +0100 Subject: [PATCH] Zigbee fix missing Light attribute in ZbLight --- tasmota/xdrv_23_zigbee_2a_devices_impl.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasmota/xdrv_23_zigbee_2a_devices_impl.ino b/tasmota/xdrv_23_zigbee_2a_devices_impl.ino index a7aa91fcc..006e7c76d 100644 --- a/tasmota/xdrv_23_zigbee_2a_devices_impl.ino +++ b/tasmota/xdrv_23_zigbee_2a_devices_impl.ino @@ -702,14 +702,19 @@ void Z_Device::jsonLightState(Z_attribute_list & attr_list) const { // dump all known values attr_list.addAttribute(F("Reachable")).setBool(getReachable()); if (validPower()) { attr_list.addAttribute(F("Power")).setUInt(getPower()); } + int32_t light_mode = -1; const Z_Data_Light & light = data.find(0); if (&light != nullptr) { + if (light.validConfig()) { + light_mode = light.getConfig(); + } light.toAttributes(attr_list); // Exception, we need to convert Hue to 0..360 instead of 0..254 if (light.validHue()) { attr_list.findOrCreateAttribute(PSTR("Hue")).setUInt(light.getHue()); } } + attr_list.addAttribute(F("Light")).setInt(light_mode); } }