From e89b746f9cb6db908d31ffaf3efe70db8d1b9484 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 17 Feb 2021 14:24:23 +0100 Subject: [PATCH] Revert "Fix scripter hue compilation error" This reverts commit bfa5c63ffff1eefeee4acc4e11ee4a10444c45e3. --- tasmota/xdrv_20_hue.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tasmota/xdrv_20_hue.ino b/tasmota/xdrv_20_hue.ino index d468c7ef0..37c3308d0 100644 --- a/tasmota/xdrv_20_hue.ino +++ b/tasmota/xdrv_20_hue.ino @@ -603,10 +603,11 @@ void HueLightStatus2(uint8_t device, String *response) // last 24 bits of Mac address + 4 bits of local light + high bit for relays 16-31, relay 32 is mapped to 0 // Zigbee extension: bit 29 = 1, and last 16 bits = short address of Zigbee device #ifndef USE_ZIGBEE -uint32_t EncodeLightId(uint8_t relay_id) { +uint32_t EncodeLightId(uint8_t relay_id) #else -uint32_t EncodeLightId(uint8_t relay_id, uint16_t z_shortaddr = 0) { +uint32_t EncodeLightId(uint8_t relay_id, uint16_t z_shortaddr = 0) #endif +{ uint8_t mac[6]; WiFi.macAddress(mac); uint32_t id = (mac[3] << 20) | (mac[4] << 12) | (mac[5] << 4); @@ -635,10 +636,11 @@ uint32_t EncodeLightId(uint8_t relay_id, uint16_t z_shortaddr = 0) { // If the Id encodes a Zigbee device (meaning bit 29 is set) // it returns 0 and sets the 'shortaddr' to the device short address #ifndef USE_ZIGBEE -uint32_t DecodeLightId(uint32_t hue_id) { +uint32_t DecodeLightId(uint32_t hue_id) #else -uint32_t DecodeLightId(uint32_t hue_id, uint16_t * shortaddr = nullptr) { +uint32_t DecodeLightId(uint32_t hue_id, uint16_t * shortaddr = nullptr) #endif +{ uint8_t relay_id = hue_id & 0xF; if (hue_id & (1 << 28)) { // check if bit 25 is set, if so we have relay_id += 16;