We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa9ed64 commit c671238Copy full SHA for c671238
custom_components/uhoo/__init__.py
@@ -1,7 +1,7 @@
1
"""The uHoo Component"""
2
3
from asyncio import gather
4
-from datetime import now, timedelta, timezone
+from datetime import datetime, timedelta, timezone
5
6
import async_timeout
7
from pyuhoo import Client
@@ -80,7 +80,7 @@ def unique_id(self):
80
def available(self):
81
"""Return if sensor is available."""
82
device = self.coordinator.data[self.serial_number]
83
- is_fresh = (now(timezone.utc) - device.timestamp) < timedelta(minutes=5)
+ is_fresh = (datetime.now(timezone.utc) - device.timestamp) < timedelta(minutes=5)
84
return self.coordinator.last_update_success and is_fresh
85
86
@property
0 commit comments