Skip to content

Commit

Permalink
refactor: update EconetBinarySensorEntityDescription to be mutable an…
Browse files Browse the repository at this point in the history
…d change cache duration to 30 seconds
  • Loading branch information
jontofront committed Dec 17, 2024
1 parent 80c3593 commit 91a34b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/econet300/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
_LOGGER = logging.getLogger(__name__)


@dataclass(frozen=True)
@dataclass
class EconetBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Describes Econet binary sensor entity."""

Expand Down
2 changes: 1 addition & 1 deletion custom_components/econet300/mem_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get(self, key):

return self._data[key].value()

def set(self, key, value, duration: int = 60):
def set(self, key, value, duration: int = 30):
"""Set the value of the specified key in the cache."""
_LOGGER.debug("Caching value for: '%s'", key)
self._data[key] = MemCacheItem(key, value, duration)

0 comments on commit 91a34b6

Please sign in to comment.