Revert "Fix scripter hue compilation error"

This reverts commit bfa5c63fff.
This commit is contained in:
Theo Arends 2021-02-17 14:24:23 +01:00
parent e3be882eb9
commit e89b746f9c
1 changed files with 6 additions and 4 deletions

View File

@ -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;