sander1988 / Indego

Home Assistant Custom Component for Bosch Indego Lawn Mower
Apache License 2.0
96 stars 29 forks source link

New device parsing json #56

Closed JiriKursky closed 4 years ago

JiriKursky commented 4 years ago

Hello, there are issues when it is a new device. In these lines should be testing on NoneType or better try - exception.

File "/usr/local/lib/python3.7/site-packages/pyIndego/init.py", line 495, in getLastCutting tmp_datetime = tmp_json['last_mowed'] TypeError: 'NoneType' object is not subscriptable

File "/usr/local/lib/python3.7/site-packages/pyIndego/init.py", line 511, in getNextCutting tmp_datetime = tmp_json['mow_next'] TypeError: 'NoneType' object is not subscriptable

Kind Regars, Jiri

Shamshala commented 4 years ago

The second error appears even for an "old" device. :slightly_smiling_face: SmartMowing must be turned on to meet the condition.

JiriKursky commented 4 years ago

I have bought mower yesterday, it is "on" and Bosch app is running well. The next date (mow_next) is not set up in calendar. My calendar is null and I think that it is root case. After first run error regarding ['last_moved'] disappeared

Shamshala commented 4 years ago

Just saying. :slightly_smiling_face:

EDIT: But you're right, i meant "to turn on the mode" to let the app/server to generate day of next mowing. Just by turning it on won't solve anything.

JiriKursky commented 4 years ago

Thank you, I am going to close that.