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
27 stars 5 forks source link

Unable to fetch maps KeyError: 'interactiveId' #18

Closed techillin closed 1 year ago

techillin commented 1 year ago

python3 -m purei9_unofficial -d -o json cloud -v 2 -c "user@user.com:password" maps -r 900000000000000000000000 2022-12-12 23:11:26,077 - purei9_unofficial.util - DEBUG - HTTP POST https://api.delta.electrolux.com/api/Clients/Wellbeing 2022-12-12 23:11:26,083 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.delta.electrolux.com:443 2022-12-12 23:11:26,352 - urllib3.connectionpool - DEBUG - https://api.delta.electrolux.com:443 "POST /api/Clients/Wellbeing HTTP/1.1" 200 None 2022-12-12 23:11:26,355 - purei9_unofficial.util - DEBUG - HTTP 200 <Response [200]> (sensitive data not shown) 2022-12-12 23:11:26,356 - purei9_unofficial.util - DEBUG - HTTP POST https://api.delta.electrolux.com/api/Users/Login 2022-12-12 23:11:26,359 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.delta.electrolux.com:443 2022-12-12 23:11:26,843 - urllib3.connectionpool - DEBUG - https://api.delta.electrolux.com:443 "POST /api/Users/Login HTTP/1.1" 200 None 2022-12-12 23:11:26,847 - purei9_unofficial.util - DEBUG - HTTP 200 <Response [200]> (sensitive data not shown) 2022-12-12 23:11:26,847 - purei9_unofficial.util - DEBUG - HTTP GET https://api.delta.electrolux.com/api/robots/900000000000000000000000/interactivemaps 2022-12-12 23:11:26,851 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.delta.electrolux.com:443 2022-12-12 23:11:27,166 - urllib3.connectionpool - DEBUG - https://api.delta.electrolux.com:443 "GET /api/robots/900000000000000000000000/interactivemaps HTTP/1.1" 200 760 2022-12-12 23:11:27,170 - purei9_unofficial.util - DEBUG - HTTP 200 <Response [200]> [{"zones":[{"name":"Room 1","id":"4afbe6a3-b856-4827-a29c-a3d55b1e6615","zoneType":"clean","vertices":[{"x":-4.333697,"y":-10.649171},{"x":-3.6309724,"y":-6.505852},{"x":0.05493144,"y":-6.580045},{"x":0.40908402,"y":-11.150099}],"roomCategory":4,"powerMode":3},{"name":"Room 2","id":"7a0a5662-6124-4db5-baae-0c28356edfb0","zoneType":"clean","vertices":[{"x":0.4653397,"y":-11.110397},{"x":0.4653397,"y":-6.3187327},{"x":3.8381655,"y":-6.318735},{"x":3.8381655,"y":-11.110397}],"roomCategory":8,"powerMode":3}],"name":"Home","rotation":0.0,"interactiveMapMessageUuid":"a6ba1659-4bed-42e4-b9d0-31c939cfdaed","id":"d19f4305-eda5-49f7-b0a0-74967d8a486d","status":0,"sequenceNumber":84,"timestamp":"2022-12-10T17:39:57+00:00","keep":true,"freeze":true}] Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/srv/homeassistant/.local/lib/python3.9/site-packages/purei9_unofficial/main.py", line 207, in for m in rc.getMaps(): File "/srv/homeassistant/.local/lib/python3.9/site-packages/purei9_unofficial/cloudv2.py", line 154, in getMaps return list(map(lambda x: CloudMap(self, x), r.json())) File "/srv/homeassistant/.local/lib/python3.9/site-packages/purei9_unofficial/cloudv2.py", line 154, in return list(map(lambda x: CloudMap(self, x), r.json())) File "/srv/homeassistant/.local/lib/python3.9/site-packages/purei9_unofficial/cloudv2.py", line 265, in init self.interactiveid = js["interactiveId"] KeyError: 'interactiveId' `

Ekman commented 1 year ago

I'm having the same issue. For reference, this is the output of a map result:

{
    "zones": [
        {
            "name": "X",
            "id": "X",
            "zoneType": "avoid",
            "vertices": [
                {
                    "x": -0.10561917,
                    "y": -3.2225614
                },
                {
                    "x": -0.1299722,
                    "y": -1.6137701
                },
                {
                    "x": -1.5171461,
                    "y": -1.6347684
                },
                {
                    "x": -1.4927931,
                    "y": -3.2435596
                }
            ],
            "roomCategory": 0,
            "powerMode": 3
        },
        {
            "name": "X",
            "id": "X",
            "zoneType": "clean",
            "vertices": [
                {
                    "x": 0.7380927,
                    "y": -1.5185915
                },
                {
                    "x": 0.67154104,
                    "y": 2.8778477
                },
                {
                    "x": -3.2852547,
                    "y": 2.8179512
                },
                {
                    "x": -3.2187028,
                    "y": -1.5784881
                }
            ],
            "roomCategory": 4,
            "powerMode": 2
        },
        {
            "name": "X",
            "id": "X",
            "zoneType": "clean",
            "vertices": [
                {
                    "x": -3.1752374,
                    "y": -1.5448498
                },
                {
                    "x": -3.2394598,
                    "y": 2.6977146
                },
                {
                    "x": -5.6025457,
                    "y": 2.661943
                },
                {
                    "x": -5.5383234,
                    "y": -1.5806212
                }
            ],
            "roomCategory": 10,
            "powerMode": 2
        },
        {
            "name": "X",
            "id": "X",
            "zoneType": "clean",
            "vertices": [
                {
                    "x": 0.76070523,
                    "y": -7.1469817
                },
                {
                    "x": 0.7008087,
                    "y": -3.190186
                },
                {
                    "x": -2.5009737,
                    "y": -3.2386532
                },
                {
                    "x": -2.4410772,
                    "y": -7.1954494
                }
            ],
            "roomCategory": 10,
            "powerMode": 2
        },
        {
            "name": "X",
            "id": "X",
            "zoneType": "clean",
            "vertices": [
                {
                    "x": -2.3744648,
                    "y": -7.2384157
                },
                {
                    "x": -2.4360251,
                    "y": -3.1717088
                },
                {
                    "x": -5.3047023,
                    "y": -3.2151337
                },
                {
                    "x": -5.2431417,
                    "y": -7.281841
                }
            ],
            "roomCategory": 10,
            "powerMode": 2
        },
        {
            "name": "X",
            "id": "X",
            "zoneType": "avoid",
            "vertices": [
                {
                    "x": -4.473666,
                    "y": -3.345567
                },
                {
                    "x": -4.4746995,
                    "y": -1.4135786
                },
                {
                    "x": -5.477051,
                    "y": -1.4131639
                },
                {
                    "x": -5.476012,
                    "y": -3.345147
                }
            ],
            "roomCategory": 0,
            "powerMode": 3
        },
        {
            "name": "X",
            "id": "X",
            "zoneType": "clean",
            "vertices": [
                {
                    "x": -1.438003,
                    "y": -3.2890937
                },
                {
                    "x": -1.3777649,
                    "y": -1.5812782
                },
                {
                    "x": -4.4868507,
                    "y": -1.6026214
                },
                {
                    "x": -4.4916263,
                    "y": -3.3086174
                }
            ],
            "roomCategory": 2,
            "powerMode": 2
        }
    ],
    "name": "X",
    "rotation": 0.0050411224,
    "interactiveMapMessageUuid": "X",
    "id": "X",
    "status": 0,
    "sequenceNumber": 1,
    "timestamp": "2022-12-09T15: 43: 27+00: 00",
    "keep": true,
    "freeze": true
}