INNER CODE UNIT · Python
__init__
dummylabs/thewatchman · custom_components/watchman/button.py:21
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Initialize the entity."""
self.hass = hass
self._attr_unique_id = f"{DOMAIN}_report_button"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, "watchman_unique_id")},
manufacturer="dummylabs",
model="Watchman",
name="Watchman",
sw_version=config_entry.runtime_data.coordinator.version,
entry_type=DeviceEntryType.SERVICE,
configuration_url="https://github.com/dummylabs/thewatchman",
)
async def async_press(self) -> None:
"""Handle the button press."""
await self.hass.services.async_call(
DOMAIN,