aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/esphomeapi.py
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2023-11-02 12:44:44 +0100
committerDennis Eriksen <d@ennis.no>2023-11-02 12:44:44 +0100
commit3eddd39a5aa52d40fbc2e0a12b463d270ddfeba2 (patch)
treeb7f4559cf252a32990f5e462dc09b2a9ad23c9b4 /scripts/esphomeapi.py
parentadd comment about manual starttime (diff)
downloadenergyscripts-3eddd39a5aa52d40fbc2e0a12b463d270ddfeba2.tar.gz
adding linting with ruff
Diffstat (limited to 'scripts/esphomeapi.py')
-rw-r--r--scripts/esphomeapi.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/esphomeapi.py b/scripts/esphomeapi.py
index 57f4ebc..5fcbe37 100644
--- a/scripts/esphomeapi.py
+++ b/scripts/esphomeapi.py
@@ -1,18 +1,18 @@
#!/usr/bin/env python3
''' Check on esphome-devices '''
-import os
-import sys
-from datetime import datetime
-from aioesphomeapi import APIClient, ReconnectLogic, SensorState, APIConnectionError
-import asyncio
import argparse
+import asyncio
import logging
-#import colorlog
-import zeroconf
+import os
+import sys
import common
+#import colorlog
+import zeroconf
+from aioesphomeapi import APIClient, APIConnectionError, ReconnectLogic, SensorState
+
sleepsec = 60
noise_psk = os.environ['el_esphome_api_psk']
@@ -56,7 +56,7 @@ async def main(args):
await api.disconnect()
def callback(state):
- if type(state) == SensorState and state.missing_state == False:
+ if type(state) == SensorState and state.missing_state is False:
log.debug('function callback(' + str(state) + ')')
sensor = sensors[state.key]