From 951751d45ffe9ea2abc7006b7c99b5bf7ab49cfb Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 1 Mar 2021 11:47:16 -1000 Subject: [PATCH 1/2] Update remote entity for activities --- docs/core/entity/remote.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/core/entity/remote.md b/docs/core/entity/remote.md index 027a654a..24cbc340 100644 --- a/docs/core/entity/remote.md +++ b/docs/core/entity/remote.md @@ -11,6 +11,8 @@ Properties should always only return information from memory and not do I/O (lik | Name | Type | Default | Description | ---- | ---- | ------- | ----------- +| current_activity | str | None | Return the current active activity | +| activity_list | list | None | Return the list of available activites | ## Supported Features @@ -18,6 +20,7 @@ Properties should always only return information from memory and not do I/O (lik | -------- | ----------- | `SUPPORT_LEARN_COMMAND` | Entity allows learning commands from devices. | `SUPPORT_DELETE_COMMAND` | Entity allows deleting commands from devices. +| `SUPPORT_ACTIVITY` | Entity supports activities. ## Methods From b76c303ae0625fb6aa57717e14b8d6a34089775a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 2 Mar 2021 13:41:35 -1000 Subject: [PATCH 2/2] Update remote.md --- docs/core/entity/remote.md | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/core/entity/remote.md b/docs/core/entity/remote.md index 24cbc340..fd8f2f3a 100644 --- a/docs/core/entity/remote.md +++ b/docs/core/entity/remote.md @@ -14,6 +14,10 @@ Properties should always only return information from memory and not do I/O (lik | current_activity | str | None | Return the current active activity | | activity_list | list | None | Return the list of available activites | +### Activity + +An activity is a predefined activity or macro that puts the remote in a specific state. For example, a "Watch TV" activity may turn on multiple devices and change the channel to a specific channel. + ## Supported Features | Constant | Description @@ -24,6 +28,42 @@ Properties should always only return information from memory and not do I/O (lik ## Methods +### Turn On Command + +```python +class MyRemote(RemoteEntity): + + def turn_on(self, activity: str = None, **kwargs): + """Turn the remote on.""" + + async def async_turn_on(self, activity: str = None, **kwargs): + """Turn the remote on.""" +``` + +### Turn Off Command + +```python +class MyRemote(RemoteEntity): + + def turn_off(self, activity: str = None, **kwargs): + """Turn the remote off.""" + + async def async_turn_off(self, activity: str = None, **kwargs): + """Turn the remote off.""" +``` + +### Toggle Command + +```python +class MyRemote(RemoteEntity): + + def toggle(self, activity: str = None, **kwargs): + """Toggle the remote.""" + + async def async_toggle(self, activity: str = None, **kwargs): + """Toggle the remote.""" +``` + ### Send Command ```python