File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed
homeassistant/components/ituran Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 55from collections .abc import Callable
66from dataclasses import dataclass
77
8- from propcache .api import cached_property
98from pyituran import Vehicle
109
1110from homeassistant .components .binary_sensor import (
@@ -69,7 +68,7 @@ def __init__(
6968 super ().__init__ (coordinator , license_plate , description .key )
7069 self .entity_description = description
7170
72- @cached_property
71+ @property
7372 def is_on (self ) -> bool :
7473 """Return true if the binary sensor is on."""
7574 return self .entity_description .value_fn (self .vehicle )
Original file line number Diff line number Diff line change 22
33from __future__ import annotations
44
5- from propcache .api import cached_property
6-
75from homeassistant .components .device_tracker import TrackerEntity
86from homeassistant .core import HomeAssistant
97from homeassistant .helpers .entity_platform import AddConfigEntryEntitiesCallback
@@ -40,12 +38,12 @@ def __init__(
4038 """Initialize the device tracker."""
4139 super ().__init__ (coordinator , license_plate , "device_tracker" )
4240
43- @cached_property
41+ @property
4442 def latitude (self ) -> float | None :
4543 """Return latitude value of the device."""
4644 return self .vehicle .gps_coordinates [0 ]
4745
48- @cached_property
46+ @property
4947 def longitude (self ) -> float | None :
5048 """Return longitude value of the device."""
5149 return self .vehicle .gps_coordinates [1 ]
Original file line number Diff line number Diff line change 66from dataclasses import dataclass
77from datetime import datetime
88
9- from propcache .api import cached_property
109from pyituran import Vehicle
1110
1211from homeassistant .components .sensor import (
@@ -133,7 +132,7 @@ def __init__(
133132 super ().__init__ (coordinator , license_plate , description .key )
134133 self .entity_description = description
135134
136- @cached_property
135+ @property
137136 def native_value (self ) -> StateType | datetime :
138137 """Return the state of the device."""
139138 return self .entity_description .value_fn (self .vehicle )
You can’t perform that action at this time.
0 commit comments