added server component

This commit is contained in:
2025-01-13 21:48:07 +01:00
parent f41de7596e
commit 2609f72941

View File

@@ -71,6 +71,10 @@ def checkPC():
if powerState['swhpamp'] == "ON": if powerState['swhpamp'] == "ON":
publ.single("cmnd/swhpamp/POWER", "off", hostname=broker, port=port, auth={'username':username,'password':password}) publ.single("cmnd/swhpamp/POWER", "off", hostname=broker, port=port, auth={'username':username,'password':password})
except Exception as e: print(e) except Exception as e: print(e)
try:
if powerState['swmicamp'] == "ON":
publ.single("cmnd/swmicamp/POWER", "off", hostname=broker, port=port, auth={'username':username,'password':password})
except Exception as e: print(e)
if __name__ == "__main__": if __name__ == "__main__":
sub=threading.Thread(target=subscribe_state) sub=threading.Thread(target=subscribe_state)