home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.73k forks source link

BETA 0.87.b0 - Error in mqqt.light - on_command_type #20685

Closed aidbish closed 5 years ago

aidbish commented 5 years ago

Home Assistant release with the issue: 0.87.0b0

Last working Home Assistant release (if known): 0.86.1

Operating environment (Hass.io/Docker/Windows/etc.): ubuntu, docker

Component/platform: mqtt.light

Description of problem: Testing latest beta, the mqtt light component give errors indicating that on_command_type is an invalid option Have checked the docs ( https://rc--home-assistant-docs.netlify.com/components/light.mqtt/) and the option still seems valid



**Traceback (if applicable):**
For manually assigned lights

2019-02-02 10:44:53 ERROR (MainThread) [homeassistant.config] Invalid config for [light.mqtt]: [on_command_type] is an invalid option for [light.mqtt]. Check: light.mqtt->on_command_type. (See ?, line ?). Please check the docs at https://home-assistant.io/components/light.mqtt/

For auto discovered mqqt lights

2019-02-02 10:44:53 ERROR (MainThread) [homeassistant.components.mqtt.light] Exception in async_discover when dispatching 'mqtt_discovery_new_light_mqtt': ({'name': 'solarlamp01', 'schema': 'json', 'state_topic': 'home/SolarLamps_ha/state/out', 'command_topic': 'home/SolarLamps_ha/state/in', 'on_command_type': 'first', 'brightness': 'true', 'rgb': 'true', 'optimistic': 'false', 'color_temp': 'true', 'effect': 'true', 'effect_list': ['Static', 'Blink', 'Breath', 'Color Wipe', 'Color Wipe Inverse', 'Color Wipe Reverse', 'Color Wipe Reverse Inverse', 'Color Wipe Random', 'Random Color', 'Single Dynamic', 'Multi Dynamic', 'Rainbow', 'Rainbow Cycle', 'Scan', 'Dual Scan', 'Fade', 'Theater Chase', 'Theater Chase Rainbow', 'Running Lights', 'Twinkle', 'Twinkle Random', 'Twinkle Fade', 'Twinkle Fade Random', 'Sparkle', 'Flash Sparkle', 'Hyper Sparkle', 'Strobe', 'Strobe Rainbow', 'Multi Strobe', 'Blink Rainbow', 'Chase White'], 'platform': 'mqtt'},)

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/mqtt/light/__init__.py", line 60, in async_discover
    config = PLATFORM_SCHEMA(discovery_payload)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/validators.py", line 207, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/validators.py", line 286, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/validators.py", line 282, in _exec
    v = func(v)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 267, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 811, in validate_callable
    return schema(data)
  File "/usr/src/app/homeassistant/components/mqtt/light/__init__.py", line 36, in validate_mqtt_light
    return schemas[value[CONF_SCHEMA]](value)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 267, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 589, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 427, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['on_command_type']
emontnemery commented 5 years ago

Starting with 0.87, configuration schema validation is stricter to not silently accept misspelled or non existing configuration variables. In this case, on_command_type is not a valid configuration variable for json schema: https://www.home-assistant.io/components/light.mqtt/#json-schema---configuration

Background here: #20562