fbjerggaard / home-assistant-barry

Barry integration for Home Assistant
3 stars 1 forks source link

Error in adding Barry #1

Closed onkelfarmor closed 2 years ago

onkelfarmor commented 2 years ago

Get this error in the log after adding Barry, no entities are created.

`Logger: homeassistant.components.sensor Source: custom_components/barry/sensor.py:92 Integration: Sensor (documentation, issues) First occurred: 8:41:39 PM (2 occurrences) Last logged: 8:41:39 PM

Error adding entities for domain sensor with platform barry Error while setting up barry platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 747, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/barry/sensor.py", line 105, in async_added_to_hass await self.check_stuff() File "/config/custom_components/barry/sensor.py", line 97, in check_stuff await self.hass.async_add_executor_job(self._update_current_price) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, **self.kwargs) File "/config/custom_components/barry/sensor.py", line 92, in _update_current_price self._current_spot_price = self._barry_home.update_spot_price(self._price_code)[0] TypeError: 'NoneType' object is not subscriptable`

fbjerggaard commented 2 years ago

@onkelfarmor There were an error in the published code - I just published a new change that should fix this. Please try updating the component and try again