Update docs based on core PR review and changes

This commit is contained in:
raman325 2021-06-25 18:14:35 -04:00
parent bbfc6ac654
commit 70d5b265c7
No known key found for this signature in database
GPG Key ID: E5FA2EFBCAB83CB7

View File

@ -11,9 +11,6 @@ A siren entity is a device whose main purpose is to control siren devices like a
| Name | Type | Default | Description |
| ----------------------- | ------ | ------------------------------------- | --------------------------------------------------------------------------------------- |
| volume_level | float | `None` | The volume level for the device. |
| active_tone | string | `NotImplementedError()` | The active tone for the device. Requires `SUPPORT_TONES`. |
| available_tones | list | `NotImplementedError()` | The available tones for the device. Requires `SUPPORT_TONES`. |
| is_on | bool | `NotImplementedError()` | Whether the device is on or off. |
### Tones
@ -24,42 +21,15 @@ A device can have different tones that are played. Integrations are responsible
Supported features constants are combined using the bitwise or (`|`) operator.
| Name | Description |
| ------------------------- | -------------------------------------------------------------- |
| `SUPPORT_TONES` | The device supports different tones. |
| `SUPPORT_VOLUME_SET` | The device supports setting the volume level of the device. |
| Name | Description |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `SUPPORT_TONES` | The device supports different tones (the tone is passed in to `turn_on` service). |
| `SUPPORT_VOLUME_SET` | The device supports setting the volume level of the device (the volume level is passed in to `turn_on` service). |
| `SUPPORT_DURATION` | The device supports setting a duration for the tone (the duration is passed in to `turn_on` service). |
## Methods
### Set volume level
```python
class MySirenEntity(SirenEntity):
# Implement one of these methods.
def set_volume_level(self, volume_level: float):
"""Set new volume level."""
async def async_set_volume_level(self, volume_level: float):
"""Set new volume level."""
```
### Set active tone
This should only be implemented if the tone can be changed.
```python
class MySirenEntity(SirenEntity):
# Implement one of these methods.
def set_active_tone(self, tone: str):
"""Set new active tone."""
async def async_set_active_tone(self, tone: str):
"""Set new active tone."""
```
### Turn on
```python