bertbert72 / HomeAssistant_VirginTivo

HomeAssistant component for control of Virgin Media Tivo boxes
GNU General Public License v3.0
27 stars 22 forks source link

Key Error: None #87

Closed danielsmith89 closed 3 years ago

danielsmith89 commented 3 years ago

For the last couple of weeks, I've had the following in my logs, and neither of my Tivo's appears as entities in Home Assistant. Was working absolutely fine up until then, and nothing has changed.

2021-06-04 10:28:42 ERROR (SyncWorker_3) [custom_components.virgintivo.media_player] Could not fetch channel listings from https://www.tvchannellists.com/List_of_channels_on_Virgin_Media_(UK)_-_New_Packages, error list index out of range 2021-06-04 10:28:42 ERROR (SyncWorker_3) [custom_components.virgintivo.media_player] No channel configuration available 2021-06-04 10:28:46 ERROR (MainThread) [homeassistant.components.media_player] Error adding entities for domain media_player with platform virgintivo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 615, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 368, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 409, in _async_write_ha_state extra_state_attributes = self.device_state_attributes File "/config/custom_components/virgintivo/media_player.py", line 805, in device_state_attributes 'base_channel_name': self._channels[self.get_sd_channel(self._channel_id)][CONF_NAME], KeyError: None 2021-06-04 10:28:46 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up virgintivo platform for media_player Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 258, in _async_setup_platform await asyncio.gather(*pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 615, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 368, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 409, in _async_write_ha_state extra_state_attributes = self.device_state_attributes File "/config/custom_components/virgintivo/media_player.py", line 805, in device_state_attributes 'base_channel_name': self._channels[self.get_sd_channel(self._channel_id)][CONF_NAME], KeyError: None

bertbert72 commented 3 years ago

Check if the latest version (0.1.21) has resolved it. If not, send me on the new log.

danielsmith89 commented 3 years ago

Check if the latest version (0.1.21) has resolved it. If not, send me on the new log.

Yep, that's sorted it - thanks.