diff --git a/custom_components/polestar_api/pypolestar/polestar.py b/custom_components/polestar_api/pypolestar/polestar.py index f54f7b1..34143bc 100644 --- a/custom_components/polestar_api/pypolestar/polestar.py +++ b/custom_components/polestar_api/pypolestar/polestar.py @@ -100,7 +100,7 @@ async def _get_vehicle_data(self): """" Get the latest vehicle data from the Polestar API.""" # get Vehicle Data params = { - "query": "query getCars { getConsumerCarsV2 { vin internalVehicleIdentifier modelYear content { model { code name __typename } images { studio { url angles __typename } __typename } __typename } hasPerformancePackage registrationNo deliveryDate currentPlannedDeliveryDate __typename }}", + "query": "query getCars { getConsumerCarsV2 { vin internalVehicleIdentifier modelYear content { model { code name __typename } images { studio { url angles __typename } __typename } __typename } hasPerformancePackage registrationNo deliveryDate currentPlannedDeliveryDate software { version __typename } __typename }}", "operationName": "getCars", "variables": "{}" } diff --git a/custom_components/polestar_api/sensor.py b/custom_components/polestar_api/sensor.py index 829dd08..b67c11b 100644 --- a/custom_components/polestar_api/sensor.py +++ b/custom_components/polestar_api/sensor.py @@ -273,6 +273,17 @@ class PolestarSensorDescription( max_value=None, dict_data=None ), + PolestarSensorDescription( + key="software_version", + name="Software Version", + icon="mdi:information-outline", + query="getConsumerCarsV2", + field_name="software/version", + unit=None, + round_digits=None, + max_value=None, + dict_data=None + ), PolestarSensorDescription( key="registration_number", name="Registration Number", diff --git a/custom_components/polestar_api/translations/en.json b/custom_components/polestar_api/translations/en.json index 156fbeb..a689961 100644 --- a/custom_components/polestar_api/translations/en.json +++ b/custom_components/polestar_api/translations/en.json @@ -69,6 +69,9 @@ "polestar_registration_number": { "name": "Registration Number" }, + "polestar_software_version": { + "name": "Software Version" + }, "polestar_estimated_fully_charged_time": { "name": "Estimated Fully Charged Time" },