first version dataclasses
This commit is contained in:
@@ -41,14 +41,16 @@ def main() -> int:
|
||||
while handler.running:
|
||||
try:
|
||||
now:float = time.time()
|
||||
|
||||
resp = projector.get(path=['status', 'storage', 'info'], params={"area":"DCP"})
|
||||
if resp is not None:
|
||||
print(json.dumps(resp, indent=2))
|
||||
|
||||
|
||||
last: float = time.time()
|
||||
cycle_time: float = last - now
|
||||
LOGGER.debug(f"Cycle Time: {cycle_time:4.3f}")
|
||||
time.sleep(INTERVAL-cycle_time)
|
||||
time.sleep(INTERVAL-cycle_time)
|
||||
except Exception as e:
|
||||
print(f"Unexpected exception: [{e}]")
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user