mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-15 13:26:28 +00:00
Improve remote documentation (#633)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
c5c8ea1826
commit
9e76aefbf0
@ -3,10 +3,6 @@ title: Remote Entity
|
|||||||
sidebar_label: Remote
|
sidebar_label: Remote
|
||||||
---
|
---
|
||||||
|
|
||||||
:::info Incomplete
|
|
||||||
This entry is incomplete. Contribution welcome.
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
@ -16,4 +12,36 @@ Properties should always only return information from memory and not do I/O (lik
|
|||||||
| Name | Type | Default | Description
|
| Name | Type | Default | Description
|
||||||
| ---- | ---- | ------- | -----------
|
| ---- | ---- | ------- | -----------
|
||||||
|
|
||||||
|
## Supported Features
|
||||||
|
|
||||||
|
| Constant | Description
|
||||||
|
| -------- | -----------
|
||||||
|
| `SUPPORT_LEARN_COMMAND` | Entity allows learning commands from devices.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
### Send Command
|
||||||
|
|
||||||
|
```python
|
||||||
|
class MyRemote(RemoteEntity):
|
||||||
|
|
||||||
|
def send_command(self, command: Iterable[str], **kwargs):
|
||||||
|
"""Send commands to a device."""
|
||||||
|
|
||||||
|
async def async_send_command(self, command: Iterable[str], **kwargs):
|
||||||
|
"""Send commands to a device."""
|
||||||
|
```
|
||||||
|
|
||||||
|
### Learn Command
|
||||||
|
|
||||||
|
Only implement this method if the flag `SUPPORT_LEARN_COMMAND` is set.
|
||||||
|
|
||||||
|
```python
|
||||||
|
class MyRemote(RemoteEntity):
|
||||||
|
|
||||||
|
def learn_command(self, **kwargs):
|
||||||
|
"""Learn a command from a device."""
|
||||||
|
|
||||||
|
async def async_learn_command(self, **kwargs):
|
||||||
|
"""Learn a command from a device."""
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user