zabuldon / teslajsonpy

Apache License 2.0
57 stars 62 forks source link

solar_type no longer listed in PRODUCT_LIST endpoint #354

Open shred86 opened 2 years ago

shred86 commented 2 years ago

https://github.com/zabuldon/teslajsonpy/blob/898d4131e0d7b5faeb1cf8bde3ef175010407c56/teslajsonpy/energy.py#L259

The Tesla API PRODUCT_LIST endpoint previously listed the solar_type key under components. This no longer seems to be the case. It is listed in the SITE_CONFIG endpoint for solar only sites, and probably one of the battery endpoints.

I just made a PR in the Tesla Custom Integration that removes using this property for now as it was only used as a part of the model information.

Documenting this for now with the plan to check the Tesla API again in the near future to update this library with any other changes.

jaymunro commented 1 year ago

solar_type still exists for me.

{
    "response":[
        {
            "id":<redacted>,
            "user_id":<redacted>,
            "vehicle_id":<redacted>,
            "vin":"<redacted>",
            "display_name":"Max",
            ...
        },
        {
            "energy_site_id":<redacted>,
            "resource_type":"battery",
            "site_name":"My Home",
            "id":"<redacted>",
            "gateway_id":"<redacted>",
            "asset_site_id":"<redacted>",
            "warp_site_number":"<redacted>",
            "energy_left":10181.789473684214,
            "total_pack_energy":13846,
            "percentage_charged":73.53596326508894,
            "battery_type":"ac_powerwall",
            "backup_capable":true,
            "battery_power":1440,
            "storm_mode_enabled":true,
            "powerwall_onboarding_settings_set":true,
            "powerwall_tesla_electric_interested_in":null,
            "sync_grid_alert_enabled":true,"breaker_alert_enabled":true,
            "components":{
                "battery":true,
                "battery_type":"ac_powerwall",
                "solar":true,
                "solar_type":"pv_panel",
                "grid":true,
                "load_meter":true,
                "market_type":"residential"                
            }
        }
    ],
    "count":2
}

Version from SITE_CONFIG: "version":"23.4.2-1 fe55682a",