use pydantic dataclasses, members are optional.. not the best
This commit is contained in:
@@ -5,6 +5,7 @@ import logging
|
||||
import json
|
||||
|
||||
import projrequest as projrequest
|
||||
from commands import ShowStatus, PowerStatusList
|
||||
from utils import *
|
||||
from influxdb_client_3 import InfluxDBClient3, Point
|
||||
|
||||
@@ -38,15 +39,17 @@ def main() -> int:
|
||||
username=env['PROJECTOR_USER'],
|
||||
password=env['PROJECTOR_PASSWORD']
|
||||
)
|
||||
ps = PowerStatusList(projector=projector)
|
||||
ss = ShowStatus(projector=projector)
|
||||
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))
|
||||
ps.get()
|
||||
ss.get()
|
||||
print(ps.dump())
|
||||
print(ss.dump())
|
||||
|
||||
|
||||
last: float = time.time()
|
||||
cycle_time: float = last - now
|
||||
LOGGER.debug(f"Cycle Time: {cycle_time:4.3f}")
|
||||
|
||||
Reference in New Issue
Block a user