Phype / purei9_unofficial

This project includes a client/library to connect to Electrolux and AEG cleaner robots.
https://pypi.org/project/purei9-unofficial
MIT License
28 stars 5 forks source link

CloudRobot.getCleaningSessions() results in KeyError: cleaningSession #15

Closed Phype closed 2 years ago

Phype commented 2 years ago

See https://github.com/Ekman/home-assistant-pure-i9/issues/10

Ekman commented 2 years ago

Using Postman I found some cleaning sessions looking like this:

[
    {
        "id": "obfuscated",
        "sessionId": 1337,
        "timeStamp": "2021-11-20T14:14:39",
        "cleanedArea": 18.87,
        "totalLifetimeCleanedArea": 10318.514
    }
]

I'm guessing it's an old format. I've had this robot for 2-3 years.

Phype commented 2 years ago

I've uploaded version 0.0.9 which attempts to fix this by changing cleaningsession.starttime to cleaningsession.endtime. The endtime is available in every item, the start time is not. Also this means the cleaningDuration will not be available in all items. Please check it out if it works for you since i couldn't test it on my account as this case doesn't happen for me.

Ekman commented 2 years ago

Thanks! I'll test and report back.

Phype commented 2 years ago

I'll assume this works as intended and close it for now.

Ekman commented 2 years ago

Yes! Sorry, I'll report back if the problem persists. Looks like its working though.