Merge pull request #72 from hjelev/dev
updated service file as script was not starting properly after restart
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
[Unit]
|
||||
Description=RPI MQTT Monitor
|
||||
After=network.target
|
||||
After=network-online.target
|
||||
Wants=network-online.targetcat
|
||||
|
||||
[Service]
|
||||
ExecStart=/home/username/git/rpi-mqtt-monitor/rpi_mon_env/bin/python /home/username/git/rpi-mqtt-monitor/src/rpi-cpu2mqtt.py --service
|
||||
@@ -8,6 +9,7 @@ WorkingDirectory=/home/username/git/rpi-mqtt-monitor/
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
User=YOUR_USER
|
||||
|
||||
[Install]
|
||||
|
||||
@@ -362,11 +362,12 @@ def publish_update_status_to_mqtt(git_update):
|
||||
client.publish("homeassistant/binary_sensor/" + config.mqtt_topic_prefix + "/" + hostname + "_git_update/config",
|
||||
config_json('git_update'), qos=config.qos)
|
||||
client.publish(config.mqtt_topic_prefix + "/" + hostname + "/git_update", git_update, qos=config.qos, retain=config.retain)
|
||||
client.loop_stop()
|
||||
|
||||
if config.update:
|
||||
if config.discovery_messages:
|
||||
client.publish("homeassistant/update/" + hostname + "/config",
|
||||
config_json('update'), qos=config.qos)
|
||||
client.loop_stop()
|
||||
client.disconnect()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user