21 lines
498 B
Python
21 lines
498 B
Python
from i7lib.client import Plant
|
|
from i7lib.timeutils import to_datetime, now
|
|
|
|
def main():
|
|
plant = Plant()
|
|
plant.read_all()
|
|
|
|
if not plant.signals:
|
|
print("no data")
|
|
return
|
|
|
|
ts = to_datetime(now()).strftime("%Y-%m-%d %H:%M:%S")
|
|
print(f"[{ts}]")
|
|
|
|
for s in sorted(plant.signals, key=lambda x: x["id"]):
|
|
label = s["name"] if s["name"] else f"signal_{s['id']}"
|
|
print(f" {s['id']:<6} {label:<24} {s['value']}")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|