hardillb / TRADFRI2MQTT

MQTT Bridge for IKEA TRÅDFRI Light Gateway
https://www.hardill.me.uk/wordpress/2017/04/06/fist-pass-tradfri-mqtt-bridge/
Apache License 2.0
81 stars 12 forks source link

Fix exceptions with lamps that have no lightsocket power #5

Closed r41d closed 7 years ago

r41d commented 7 years ago

I previously did a fix that would prevent the handling of a registered lamp with no power on the lightbulb socket, these lamps miss almost all parameters in the LIGHT = "3311" json object. I noticed another case that can occur (and did occur to me): ONOFF is present but DIMMER is not, this happened with a lamp with the light switch turned off. Previously, this triggered an exception. All currently available Tradfri illuminants support dimming of brightness (even those that cant change temperature), this fix prevents errors with lamps that lack the latter or both. If the gateway reports that dimming support or color temperature support is missing, then just the interface for that is omitted.