From eabc1d96c3e80b0ba8ddc92e4990f2a7980582c5 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Thu, 31 Aug 2023 15:20:33 +0100 Subject: [PATCH] Add restart button to demo config --- haco/configs/demo.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/haco/configs/demo.py b/haco/configs/demo.py index 0e68df9..ebe6e4f 100644 --- a/haco/configs/demo.py +++ b/haco/configs/demo.py @@ -1,3 +1,13 @@ +from haco import Button, Tasmota + +restart = Button('Restart Tasmota', icon='restart') + + +@restart.callback() +def ha(value) -> Tasmota[str, 'tasmota.cmd("restart 1")']: + return value + + from haco import Sensor memory = Sensor('Memory Free', icon='memory', uom=Sensor.UOM.DATA_KILOBYTES, device_class=Sensor.DEVICE_CLASS.DATA_SIZE)