TCP test to work offline
This commit is contained in:
1 parent
d30fb7f04a
commit
41214fd082
3 files changed
+24
-18
No files matched your search
@@ -90,6 +90,7 @@ class Sensor(Entity):
|
||||
def update(self):
|
||||
"""Get the latest value for this sensor."""
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||
sock.settimeout(self._config[CONF_TIMEOUT])
|
||||
try:
|
||||
sock.connect(
|
||||
(self._config[CONF_HOST], self._config[CONF_PORT]))
|
||||
|
||||
Reference in new issue
Block a user