INNER CODE UNIT · Python

WatchmanReportButton

dummylabs/thewatchman · custom_components/watchman/button.py:14

class WatchmanReportButton(ButtonEntity):
    """Button entity to trigger Watchman report."""

    _attr_has_entity_name = True
    _attr_translation_key = "create_report_file"
    _attr_icon = "mdi:file-document-outline"

    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,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…