add try
This commit is contained in:
parent
24e4bac203
commit
d5710eaa20
@ -62,6 +62,7 @@ def subscribe(client: mqtt_client, topic):
|
||||
|
||||
|
||||
def run():
|
||||
try:
|
||||
client = connect_mqtt()
|
||||
house_battery_soc = subscribe(client, topic_house_battery_soc)
|
||||
house_battery_power = subscribe(client, topic_house_battery_power)
|
||||
@ -108,15 +109,15 @@ def run():
|
||||
|
||||
client.loop_forever()
|
||||
|
||||
except IOError as e:
|
||||
logging.info(e)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logging.info("ctrl + c:")
|
||||
epd2in13b_V3.epdconfig.module_exit()
|
||||
exit()
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
|
||||
#except IOError as e:
|
||||
# logging.info(e)
|
||||
|
||||
#except KeyboardInterrupt:
|
||||
# logging.info("ctrl + c:")
|
||||
# epd2in13b_V3.epdconfig.module_exit()
|
||||
# exit()
|
||||
|
Loading…
Reference in New Issue
Block a user