Skip to content

Commit 7b4f5ad

Browse files
authored
Ituran: Don't cache properties (home-assistant#156281)
1 parent 583b439 commit 7b4f5ad

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

homeassistant/components/ituran/binary_sensor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from collections.abc import Callable
66
from dataclasses import dataclass
77

8-
from propcache.api import cached_property
98
from pyituran import Vehicle
109

1110
from 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)

homeassistant/components/ituran/device_tracker.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from __future__ import annotations
44

5-
from propcache.api import cached_property
6-
75
from homeassistant.components.device_tracker import TrackerEntity
86
from homeassistant.core import HomeAssistant
97
from 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]

homeassistant/components/ituran/sensor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from dataclasses import dataclass
77
from datetime import datetime
88

9-
from propcache.api import cached_property
109
from pyituran import Vehicle
1110

1211
from 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)

0 commit comments

Comments
 (0)