Compare commits
No commits in common. "1d98bbe2278ea5334fe4c8485a60e0a50039d74d" and "2609f729412abffa9dd21fe71b40e5bf4245c46d" have entirely different histories.
1d98bbe227
...
2609f72941
@ -40,13 +40,10 @@ def subscribe(client: mqtt_client):
|
||||
def on_message(client, userdata, msg):
|
||||
topic = msg.topic
|
||||
if "tele" in topic:
|
||||
try:
|
||||
if "STATE" in topic:
|
||||
data = json.loads(msg.payload.decode())
|
||||
device = topic.split('/')[1]
|
||||
powerState[device] = data['POWER']
|
||||
except:
|
||||
pass
|
||||
if "STATE" in topic:
|
||||
data = json.loads(msg.payload.decode())
|
||||
device = topic.split('/')[1]
|
||||
powerState[device] = data['POWER']
|
||||
if "stat" in topic:
|
||||
device = topic.split('/')[1]
|
||||
powerState[device] = msg.payload.decode()
|
||||
|
@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=Automatic smart plug manager for audio devices
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=angoosh
|
||||
ExecStart=python /home/angoosh/Scripts/audio_automation_pc.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user