e-paper-display/examples/test.py

48 lines
937 B
Python
Raw Normal View History

2024-02-01 22:34:31 +00:00
topic0 = {
"topic" : "openWB/bat/get/soc",
"line" : "0",
"value" : ""
}
topic1 = {
"topic" : "openWB/bat/get/power",
"line" : "1",
"value" : ""
}
topic2 = {
"topic" : "openWB/counter/7/get/power",
"line" : "2",
"value" : ""
}
topic3 = {
"topic" : "openWB/pv/8/get/power",
"line" : "3",
"value" : ""
}
topic4 = {
"topic" : "openWB/graph/lastlivevaluesJson", #house-power
"line" : "4",
"value" : ""
}
topic5 = {
"topic" : "openWB/vehicle/4/get/soc",
"line" : "5",
"value" : ""
}
topic6 = {
"topic" : "openWB/internal_chargepoint/0/get/powers",
"line" : "6",
"value" : ""
}
topics = {0:topic0,1:topic1,2:topic2,3:topic3,4:topic4,5:topic5,6:topic6}
topics[3]['value'] = '20'
2024-02-01 22:48:39 +00:00
print(topics[3]["line"])
for topic_id, topic_info in topics.items():
print("\nTopic ID:", topic_id)
for key in topic_info:
print(key + ':', topic_info[key])