unixorn / ha-mqtt-discoverable

Python module to create MQTT entities that are automatically discovered by Home Assistant
Apache License 2.0
89 stars 21 forks source link

Default color_mode for light causes error in Home Assistant mqtt discovery #160

Closed drulia closed 8 months ago

drulia commented 8 months ago

Describe the bug color_mode: False is throwing error in Home Assistant discovery

To Reproduce From example setup light, but either not set color_mode or say it's false (which is default),

    light_info = LightInfo(
        name="test_light",
        brightness=True
    )

Expected behavior Light discovered by mqtt, but instead in the logs there is this error: [homeassistant.components.mqtt.mixins] Error 'some but not all values in the same group of inclusion 'color_mode' @ data[<color_mode>]' when processing MQTT discovery message topic: 'homeassistant/light/test_light/config'

To go around this, I can set color_mode=None, that does the trick and doesn't send any info about color mode via mqtt.