Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not work anymore Homeassistant 2022.3.8 #11

Open
egbaci opened this issue Apr 5, 2022 · 1 comment
Open

Not work anymore Homeassistant 2022.3.8 #11

egbaci opened this issue Apr 5, 2022 · 1 comment

Comments

@egbaci
Copy link

egbaci commented Apr 5, 2022

Error while setting up bgh_smart platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/bgh_smart/climate.py", line 77, in setup_platform
add_entities(BghHVAC(device, client) for device in devices)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 321, in _schedule_add_entities
list(new_entities),
File "/config/custom_components/bgh_smart/climate.py", line 77, in
add_entities(BghHVAC(device, client) for device in devices)
File "/config/custom_components/bgh_smart/climate.py", line 97, in init
self._parse_data()
File "/config/custom_components/bgh_smart/climate.py", line 113, in _parse_data
self._mode = MAP_MODE_ID[self._device['data']['mode_id']]
KeyError: 255

@r-antonio
Copy link

r-antonio commented Apr 14, 2022

Just testing this, I need AA batteries to confirm but changing MAP_MODE_ID and MAP_FAN_MODE_ID last key which is 254 to 255, the value returned now by BGH's API, the script doesn't crash and HA detects the devices

Edit: I checked pybgh library, the value 255 is mapped there as 'no_change' but not mapped here, I don't know much of HA if adding that could be a problem or not https://github.com/mool/pybgh/blob/a7ce9735b3a47ffb520132386ac1e36eedb61378/pybgh/__init__.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants