TeslaPy icon indicating copy to clipboard operation
TeslaPy copied to clipboard

looks like charge_state has moved

Open doubledrat opened this issue 3 years ago • 2 comments

for me at least it's now under ['data']

        "data": {
            "charge_state": {
                "battery_heater_on": false,
                "battery_level": 82,
    

which breaks last_seen()

looks like gui_settings is also under there now, which will break a few other things

doubledrat avatar Sep 24 '22 13:09 doubledrat

Actually the response of get_latest_vehicle_data() has changed:

{
    "pb_data": "EiIKAg...",
    "data": {
        "charge_state": {
            "battery_heater_on": false,
etc.

I am going to make a fix for this.

tdorssers avatar Sep 24 '22 13:09 tdorssers

"CACHED_PROTO_VEHICLE_DATA" has been renamed to "LATEST_VEHICLE_DATA" in official app version 4.12 and it has been removed in app version 4.13. I am guessing that "VEHICLE_DATA" is now returning cached data when the vehicle is asleep.

tdorssers avatar Sep 24 '22 14:09 tdorssers

I tried the example in the README.md with 2.7.0 and vehicles[0]['charge_state']['battery_level'] gives me 0. I needet to use vehicles[0].get_vehicle_data()['charge_state']['usable_battery_level'] to get the correct SoC.

kaistian avatar Dec 19 '22 14:12 kaistian

Should be fixed in commit 87fd806

tdorssers avatar May 21 '23 09:05 tdorssers