File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11"""The uHoo Component"""
22
33from asyncio import gather
4- from datetime import datetime , timedelta , timezone
54
65import async_timeout
76from pyuhoo import Client
1716
1817from .const import DATA_COORDINATOR , DOMAIN , LOGGER , UPDATE_INTERVAL
1918
19+ # from datetime import datetime, timedelta, timezone
20+
21+
2022PLATFORMS = ["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 :
You can’t perform that action at this time.
0 commit comments