Skip to content

Commit bccb346

Browse files
SaccaSacca
authored andcommitted
Removed is_fresh check
(wasn't working, probably not utc time?)
1 parent beab0c2 commit bccb346

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

custom_components/uhoo/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""The uHoo Component"""
22

33
from asyncio import gather
4-
from datetime import datetime, timedelta, timezone
54

65
import async_timeout
76
from pyuhoo import Client
@@ -17,6 +16,9 @@
1716

1817
from .const import DATA_COORDINATOR, DOMAIN, LOGGER, UPDATE_INTERVAL
1918

19+
# from datetime import datetime, timedelta, timezone
20+
21+
2022
PLATFORMS = ["sensor"]
2123

2224

@@ -81,9 +83,10 @@ def unique_id(self):
8183
@property
8284
def available(self):
8385
"""Return if sensor is available."""
84-
device = self.coordinator.data[self.serial_number]
85-
is_fresh = (datetime.now(timezone.utc) - device.timestamp) < timedelta(minutes=5)
86-
return self.coordinator.last_update_success and is_fresh
86+
# device = self.coordinator.data[self.serial_number]
87+
# is_fresh = (datetime.now(timezone.utc) - device.timestamp) < timedelta(minutes=5)
88+
# return self.coordinator.last_update_success and is_fresh
89+
return self.coordinator.last_update_success
8790

8891
@property
8992
def should_poll(self) -> bool:

0 commit comments

Comments
 (0)