gruijter / com.gruijter.zigbee2mqtt

Connect Zigbee devices to Homey via Zigbee2MQTT
GNU General Public License v3.0
6 stars 10 forks source link

Fix the color mode for the colored lamps #9

Closed Vitaliy-Yakovchuk closed 1 year ago

Vitaliy-Yakovchuk commented 1 year ago

There was an issue with the color lamps, specifically the NOUS/Philips Hue models. When I switched to the color mode in Homey, it automatically changed to the temperature mode. In Z2M, there are read-only settings where I've added a mapping:

color_mode: (val) => ['light_mode', val === 'xy' || val === 'hs' ? 'color' : 'temperature'],

I'm not entirely certain this handles every scenario, but I've aimed to maintain logic for lamps that don't support this settings + switched to 'hs' payload if lamp support it.