File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
custom_components/teslemetry Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1623,15 +1623,12 @@ def __init__(
16231623 def _async_update_attrs (self ) -> None :
16241624 """Update the attributes of the sensor."""
16251625
1626- if not self .has :
1627- return
1628-
1629- if self .exactly (None ):
1626+ value = self ._value
1627+ if not value :
16301628 self ._attr_native_value = "None"
16311629 self ._attr_extra_state_attributes = {}
16321630 return
16331631
1634- value = self ._value
16351632 for vehicle in self ._vehicles :
16361633 if vehicle .vin == value :
16371634 self ._attr_native_value = vehicle .device ["name" ]
@@ -1640,6 +1637,7 @@ def _async_update_attrs(self) -> None:
16401637 "model" : vehicle .device ["model" ],
16411638 }
16421639 return
1640+
16431641 self ._attr_native_value = value
16441642 model = MODELS .get (value [3 ]) if isinstance (value , str ) and len (value ) > 3 else None
16451643 self ._attr_extra_state_attributes = {
You can’t perform that action at this time.
0 commit comments