From aa700eb37150e084cb721bb5fcf524007b7c8747 Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Thu, 1 Feb 2024 08:20:09 +0100 Subject: [PATCH] Update rpi-cpu2mqtt.py --- src/rpi-cpu2mqtt.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rpi-cpu2mqtt.py b/src/rpi-cpu2mqtt.py index afa71b6..05b6f61 100644 --- a/src/rpi-cpu2mqtt.py +++ b/src/rpi-cpu2mqtt.py @@ -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() \ No newline at end of file + gather_and_send_info()