From c1d7d40a4ded7e3b5d28f1789aed195ec555b516 Mon Sep 17 00:00:00 2001 From: Tuen Lee Date: Sun, 19 Nov 2023 00:18:02 +0100 Subject: [PATCH] add last updated --- custom_components/polestar_api/sensor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/custom_components/polestar_api/sensor.py b/custom_components/polestar_api/sensor.py index 847d526..31b293d 100644 --- a/custom_components/polestar_api/sensor.py +++ b/custom_components/polestar_api/sensor.py @@ -78,6 +78,16 @@ class PolestarSensorDescription( state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.BATTERY, ), + PolestarSensorDescription( + key="last_updated", + name="Last updated", + path="{vin}/recharge-status", + response_path="batteryChargeLevel.timestamp", + unit=None, + round_digits=None, + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TIMESTAMP, + ), PolestarSensorDescription( key="electric_range", name="EV Range",