Open sverrevh opened 7 years ago
This plugin already has implemented color changing. I think a accessory definition in the homekit plugin is needed. I will check the homekit interface, change my plugin if needed and make a pull request to make it possible.
Homekit/Pimatic-HAP expects a color in Hue and Saturation: Starting here is the conversion code from XY to Hue/saturation/light and the other way around: https://github.com/szokeptr/homebridge-tradfri-plugin/blob/master/index.js#L3542
http://stackoverflow.com/a/9493060 http://stackoverflow.com/a/36061908
The conversion however must be done in pimatic-hap. I will have a look into this.
This is actually now less of an issue when you let the gateway handle HomeKit directly, also makes more sense to do so.
This plugin for homebridge (https://github.com/szokeptr/homebridge-tradfri-plugin) supports colors in Homekit. According to https://github.com/michbeck100/pimatic-hap/issues/74#issuecomment-316126320 changes need to be made to this plugin first in order to get it working with the pimatic-HAP plugin.