Pyhass / Hive-Custom-Component

A custom version of the home assistant hive component
MIT License
33 stars 17 forks source link

[BUG] #135

Open tempus2016 opened 1 year ago

tempus2016 commented 1 year ago

Describe the bug

Logger: homeassistant.helpers.entity
Source: components/hive/switch.py:67
First occurred: 20:42:07 (1 occurrences)
Last logged: 20:42:07

Update for switch.downstairs_heat_on_demand fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/components/hive/switch.py", line 67, in async_update
    await self.hive.session.updateData(self.device)
  File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 329, in updateData
    await self.getDevices(device["hiveID"])
  File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 456, in getDevices
    self.config.homeID = api_resp_p[hiveType]["homes"][0]["id"]
IndexError: list index out of range
Home Assistant 2022.11.1
Supervisor 2022.10.2
Operating System 9.3
Frontend 20221102.1 - latest
KJonline commented 1 year ago

@tempus2016 Are you using the main hive Owner account?

tempus2016 commented 1 year ago

@tempus2016 Are you using the main hive Owner account?

Yes

spants commented 1 year ago

I am having a similar problem

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/hive/init.py", line 89, in async_setup_entry File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 510, in startSession return await self.createDevices() File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 534, in createDevices eval("self." + code) File "", line 1, in File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 131, in addList device = self.helper.getDeviceData(data) File "/usr/local/lib/python3.10/site-packages/apyhiveapi/helper/hive_helper.py", line 98, in getDeviceData device = self.session.data.devices[product["props"]["trvs"][0]] IndexError: list index out of range