Skip to content

Error while setting up virgintivo platform for media_player occurs 50% of the time after a restart of HA #123

@craigo1975

Description

@craigo1975

Hi,

I randomly get this error when I restart HA...around 50% of the time, so I'm thinking it may be a slow network issue?

Logger: homeassistant.components.media_player
Source: helpers/entity_platform.py:365
integration: Media Player (documentation, issues)
First occurred: 10:02:26 (1 occurrences)
Last logged: 10:02:26
Error while setting up virgintivo platform for media_player

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/virgintivo/media_player.py", line 230, in setup_platform
hass.data[DATA_VIRGINTIVO].append(VirginTivo(extra[CONF_HOST], channels, tivo_id, extra[CONF_NAME],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/virgintivo/media_player.py", line 330, in init
self.get_guide_channels()
File "/config/custom_components/virgintivo/media_player.py", line 341, in get_guide_channels
for channel in channels_data["channels"]:
~~~~~~~~~~~~~^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str

Any advice would be welcome to prevent this......

Below is my yaml setup:

virgin tivo

media_player:

  • platform: virgintivo
    tivos:
    1:
    name: Virgin V6
    host: 192.168.0.76
    force_hd: true
    tvchannellists:
    enable: True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions