This commit is contained in:
robert 2024-01-31 23:37:40 +00:00
parent 007ed0da85
commit 055d58bc34

View File

@ -62,16 +62,17 @@ def subscribe(client: mqtt_client, topic):
def run(): def run():
try:
client = connect_mqtt() client = connect_mqtt()
house_battery_soc = subscribe(client, topic_house_battery_soc) house_battery_soc = subscribe(client, topic_house_battery_soc)
house_battery_power = subscribe(client, topic_house_battery_power) house_battery_power = subscribe(client, topic_house_battery_power)
power_import_export = subscribe(client, topic_power_import_export) power_import_export = subscribe(client, topic_power_import_export)
pv_power = subscribe(client, topic_pv_power) pv_power = subscribe(client, topic_pv_power)
house_power = subscribe(client, topic_house_power) house_power = subscribe(client, topic_house_power)
car_soc = subscribe(client, topic_car_soc) car_soc = subscribe(client, topic_car_soc)
charge_point_power = subscribe(client, topic_charge_point_power) charge_point_power = subscribe(client, topic_charge_point_power)
try:
logging.info("epd2in13b_V3 Demo") logging.info("epd2in13b_V3 Demo")
epd = epd2in13b_V3.EPD() epd = epd2in13b_V3.EPD()
@ -107,7 +108,7 @@ def run():
logging.info("Goto Sleep...") logging.info("Goto Sleep...")
epd.sleep() epd.sleep()
client.loop_forever() client.loop_forever()
except IOError as e: except IOError as e:
logging.info(e) logging.info(e)