tdorssers / TeslaPy

A Python module to use the Tesla Motors Owner API
MIT License
374 stars 83 forks source link

looks like charge_state has moved #103

Closed doubledrat closed 1 year ago

doubledrat commented 2 years ago

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

tdorssers commented 2 years ago

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 commented 2 years ago

"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.

kaistian commented 1 year ago

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.

tdorssers commented 1 year ago

Should be fixed in commit 87fd806