homeassistant-config: ATTR_EFFECT causing errors since ha 2023.11.1
Logger: homeassistant.components.python_script.light_store.py
Source: components/python_script/__init__.py:224
Integration: Python Scripts (documentation, issues)
First occurred: 14:33:51 (1 occurrences)
Last logged: 14:33:51
Error executing script: string value is None for dictionary value @ data['effect']
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 224, in execute
exec(compiled.code, restricted_globals) # noqa: S102
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "light_store.py", line 116, in <module>
File "/usr/src/homeassistant/homeassistant/core.py", line 1940, in call
).result()
^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/src/homeassistant/homeassistant/core.py", line 2001, in async_call
processed_data: dict[str, Any] = handler.schema(service_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 232, in __call__
return self._exec((Schema(val) for val in self.validators), v)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 351, in _exec
v = func(v)
^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 229, in _run
return self._exec(self._compiled, value, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 353, in _exec
v = func(path, v)
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
return schema(data)
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 595, in validate_dict
return base_validate(path, iteritems(data), out)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 433, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: string value is None for dictionary value @ data['effect']
The Hue-Light I`m using has no “effect”, but this had no effect on the script since the recent Homeassistant update
min_color_temp_kelvin: 2202
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 454
supported_color_modes:
- color_temp
color_mode: color_temp
brightness: 74
color_temp_kelvin: 2439
color_temp: 410
hs_color:
- 29.04
- 74.777
rgb_color:
- 255
- 156
- 64
xy_color:
- 0.554
- 0.389
off_with_transition: false
off_brightness: null
friendly_name: Hängelampe
supported_features: 40
icon: phu:ceiling-fair-semiflush
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 15 (15 by maintainers)
Ok. Now it makes more sense.
BTW, that change in 2023.11 not only includes the attributes when the light is off (which it did not do before), but it also includes attributes with None/null values even when the light is on. It used to NOT include any attributes whose values were None/null before. So, this explains the problem.
I’ll go ahead and accept your change and make a new release.