Update rpi-cpu2mqtt.py
This commit is contained in:
committed by
GitHub
parent
36cccac028
commit
aa700eb371
@@ -303,9 +303,7 @@ def config_json(what_config):
|
||||
data["title"] = "Device Update"
|
||||
data["device_class"] = "update"
|
||||
data["state_class"] = "measurement"
|
||||
data["payload_on"] = "on"
|
||||
data["payload_off"] = "off"
|
||||
data["value_template"] = "{{ 'on' if value_json.installed_ver != value_json.new_ver else 'off' }}"
|
||||
data["value_template"] = "{{ 'ON' if value_json.installed_ver != value_json.new_ver else 'OFF' }}"
|
||||
elif what_config == "update":
|
||||
version = check_git_version(script_dir).strip()
|
||||
data["icon"] = "mdi:update"
|
||||
@@ -598,4 +596,4 @@ if __name__ == '__main__':
|
||||
sys.exit(0)
|
||||
time.sleep(1) # Check the exit flag every second
|
||||
else:
|
||||
gather_and_send_info()
|
||||
gather_and_send_info()
|
||||
|
||||
Reference in New Issue
Block a user