ledfxrm
ledfxrm copied to clipboard
change attribute lookup from has_key to in
fixes #6
I received this error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 427, in _async_add_entity
original_icon=entity.icon,
File "/config/custom_components/ledfxrm/light.py", line 185, in icon
if self.deviceconfig.has_key("icon_name"):
AttributeError: 'dict' object has no attribute 'has_key'
It seems has_key was removed in python 3: https://stackoverflow.com/a/33727186
So use the in operator instead seemed to work in my testing, although I do not have a custom icon (I think) so was unable to test inside the if statement.
I noticed the HACS Action is failing with the error ❌ manifest.json file missing key 'version' (more-info: https://hacs.xyz/docs/publish/include#check-manifest ). When looking at the docs I see that "For core integrations, this should be omitted.". Is there a way to disable this check (this is a core integration right?)?