Skip to content

Commit

Permalink
Fix on updating once
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGos committed Dec 24, 2024
1 parent 8745c56 commit fdb0622
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions custom_components/davis_vantage/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from functools import cached_property
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR_DOMAIN,
BinarySensorEntity,
Expand Down Expand Up @@ -64,8 +63,8 @@ def __init__(
)
self._attr_device_info = coordinator.device_info

@cached_property
def is_on(self) -> bool | None:
@property
def is_on(self) -> bool | None: # type: ignore
"""Return the is_on of the sensor."""
key = self.entity_description.key
data = self.coordinator.data
Expand Down
5 changes: 2 additions & 3 deletions custom_components/davis_vantage/sensor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
from functools import cached_property

from homeassistant.components.sensor import (
SensorEntity,
Expand Down Expand Up @@ -625,8 +624,8 @@ def __init__(
self._attr_unique_id = f"{entry_id}-{DEFAULT_NAME} {KEY_TO_NAME[description.key]}"
self._attr_device_info = coordinator.device_info

@cached_property
def native_value(self) -> StateType:
@property
def native_value(self) -> StateType: # type: ignore
"""Return the state of the sensor."""
key = self.entity_description.key
data = self.coordinator.data # type: ignore
Expand Down

0 comments on commit fdb0622

Please sign in to comment.