bosch-thermostat / bosch-thermostat-client-python

Python3 asyncio package to talk to Bosch thermostat devices.
Apache License 2.0
23 stars 20 forks source link

fetch_all : TypeError: list indices must be integers or slices, not str #31

Closed doudz closed 1 year ago

doudz commented 1 year ago

Trying to use fetch_all I get the following error

File "/srv/homeassistant/lib/python3.10/site-packages/bosch_thermostat_client/sensors/energy.py", line 80, in fetch_all
    self._past_data[row["d"]] = row
TypeError: list indices must be integers or slices, not str

https://github.com/bosch-thermostat/bosch-thermostat-client-python/blob/dev/bosch_thermostat_client/sensors/energy.py#L80

doudz commented 1 year ago

https://github.com/bosch-thermostat/bosch-thermostat-client-python/blob/dev/bosch_thermostat_client/sensors/energy.py#L39

self._past_data = []should be replaced by self._past_data = {}

pszafer commented 1 year ago

you're right.