From ab4540aff419747bcfcc7b5822f2ff49b0250fa4 Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Wed, 30 Aug 2023 15:17:25 +0100 Subject: [PATCH] Implement Button control --- haco/button.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 haco/button.py diff --git a/haco/button.py b/haco/button.py new file mode 100644 index 0000000..0c288a7 --- /dev/null +++ b/haco/button.py @@ -0,0 +1,21 @@ +from haco import schema +from haco.control import Control + + +class Button(Control): + NAME = 'button' + + @classmethod + def get_schema(cls): + return schema.Schema( + capabilities=[ + schema.Capability( + name='state', + ha=schema.HomeAssistant(announce_data=schema.AnnounceTopic(key='{io_ha}_topic')), + tamota=None + ) + ] + ) + + def __init__(self, name, icon=None): + super().__init__(name, icon=icon)