diff --git a/custom_components/volkswagen_we_connect_id/device_tracker.py b/custom_components/volkswagen_we_connect_id/device_tracker.py index 6333a51..3778787 100644 --- a/custom_components/volkswagen_we_connect_id/device_tracker.py +++ b/custom_components/volkswagen_we_connect_id/device_tracker.py @@ -88,3 +88,17 @@ def source_type(self): def icon(self): """Return the icon.""" return "mdi:car" + + @property + def extra_state_attributes(self): + """Return timestamp of when the data was captured.""" + try: + return { + "last_captured": get_object_value( + self.data.domains["parking"][ + "parkingPosition" + ].carCapturedTimestamp.value + ) + } + except KeyError: + return None