mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 04:16:29 +00:00
Add device class support for button entity (#1145)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
dae81bc86f
commit
c34b75731a
@ -16,12 +16,10 @@ and can be helpful for controlling device features like (but not limited to):
|
||||
|
||||
If you want to represent something that can be turned on and off (and thus have an actual state), you should use a `switch` entity instead. If you want to integrate a real, physical, stateless button device in Home Assistant, you can do so by firing custom events. The entity button entity isn't suitable for these cases.
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
As this integration is stateless, it doesn't provide any specific properties for itself.
|
||||
Other properties that are common to all entities such as `icon`, `name` etc are still applicable.
|
||||
Other properties that are common to all entities such as `device_class`, `icon`, `name` etc are still applicable.
|
||||
|
||||
## Methods
|
||||
|
||||
@ -41,3 +39,12 @@ class MyButton(ButtonEntity):
|
||||
async def async_press(self) -> None:
|
||||
"""Handle the button press."""
|
||||
```
|
||||
|
||||
### Available device classes
|
||||
|
||||
Optionally specifies what type of entity it is. It will possibly map to Google device types.
|
||||
|
||||
| Value | Description
|
||||
| ----- | -----------
|
||||
| restart | The button entity restarts the device.
|
||||
| update | The button entity updates the software of the device.
|
||||
|
Loading…
x
Reference in New Issue
Block a user