diff --git a/plugin/homeassistant.py b/plugin/homeassistant.py index c7ffa39..b6a685e 100644 --- a/plugin/homeassistant.py +++ b/plugin/homeassistant.py @@ -491,3 +491,15 @@ def _default_action(self): def activate(self) -> None: """Activate scene.""" self._client.call_services("scene", "turn_on", data=self.target) + +class Button(BaseEntity): + def __init__(self, client: Client, entity: dict) -> None: + super().__init__(client, entity) + + def _default_action(self): + self.press() + + @service(icon="gesture-tap") + def press(self) -> None: + """Press button""" + self._client.call_services("button", "press", data=self.target) diff --git a/plugin/icons.py b/plugin/icons.py index 95e7218..873a225 100644 --- a/plugin/icons.py +++ b/plugin/icons.py @@ -47,6 +47,7 @@ image_broken = "F02ED" swap_horizontal_bold = "F0BCD" history = "F02DA" +gesture_tap = "F0741" DEFAULT_ICONS = { @@ -68,6 +69,7 @@ "group_off": checkbox_multiple_blank_outline, "input_boolean": checkbox_blank_circle_outline, "input_boolean_on": checkbox_marked, + "button": gesture_tap, "input_select": form_select, "input_number": counter, "input_text": form_textbox,