philippelt / netatmo-api-python

Netatmo connect API python client (for Netatmo information, see https://dev.netatmo.com)
GNU General Public License v3.0
193 stars 121 forks source link

[Fix] Don't crash MinMaxTH() on empty body #67

Closed RichieB2B closed 1 year ago

RichieB2B commented 1 year ago

I have an Netatmo account with old stations and modules in it that are no longer active. This means that not all data from my modules is available. I experienced this crash:

$ python3 lnetatmo.py 
Traceback (most recent call last):
  File "/home/dsmr/dsmr-reader/./.venv/lib/python3.9/site-packages/lnetatmo.py", line 914, in <module>
    weatherStation.MinMaxTH()                          # Test GETMEASUR
  File "/home/dsmr/dsmr-reader/./.venv/lib/python3.9/site-packages/lnetatmo.py", line 494, in MinMaxTH
    T = [v[0] for v in resp['body'].values()]
AttributeError: 'list' object has no attribute 'values'

I fixed this with the attached patch.

philippelt commented 1 year ago

Please, close issues if applicable. Sorry for the delay, I am totally unavailable due to work load...