1 """Support for button entities."""
3 from __future__
import annotations
5 from dataclasses
import dataclass, field
7 from gardena_bluetooth.const
import Reset
8 from gardena_bluetooth.parse
import CharacteristicBool
15 from .
import GardenaBluetoothConfigEntry
16 from .entity
import GardenaBluetoothDescriptorEntity
19 @dataclass(frozen=True)
21 """Description of entity."""
27 """Context needed for update coordinator."""
28 return {self.char.uuid}
33 key=Reset.factory_reset.uuid,
34 translation_key=
"factory_reset",
35 entity_category=EntityCategory.DIAGNOSTIC,
36 entity_registry_enabled_default=
False,
37 char=Reset.factory_reset,
44 entry: GardenaBluetoothConfigEntry,
45 async_add_entities: AddEntitiesCallback,
47 """Set up button based on a config entry."""
48 coordinator = entry.runtime_data
51 for description
in DESCRIPTIONS
52 if description.key
in coordinator.characteristics
58 """Representation of a button."""
60 entity_description: GardenaBluetoothButtonEntityDescription
63 """Trigger button action."""
None write(self, Characteristic[CharacteristicType] char, CharacteristicType value)