feat: Einstellungen, Neustart, Diagnose-Sensoren und Diagnose-Download

This commit is contained in:
Michael Sauer
2026-09-16 16:08:47 +02:00
parent be0a8e21b6
commit cc318c9d25
13 changed files with 608 additions and 1 deletions
+34
View File
@@ -0,0 +1,34 @@
"""Reboot button of a ninlight lamp. A factory reset is deliberately not offered."""
from __future__ import annotations
from homeassistant.components.button import ButtonDeviceClass, ButtonEntity
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from .coordinator import NinlightConfigEntry, NinlightCoordinator
from .entity import NinlightEntity
PARALLEL_UPDATES = 0
async def async_setup_entry(
hass: HomeAssistant,
entry: NinlightConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
) -> None:
async_add_entities([NinlightRebootButton(entry.runtime_data)])
class NinlightRebootButton(NinlightEntity, ButtonEntity):
"""Restart the lamp."""
_attr_device_class = ButtonDeviceClass.RESTART
_attr_entity_category = EntityCategory.CONFIG
def __init__(self, coordinator: NinlightCoordinator) -> None:
super().__init__(coordinator, "reboot")
async def async_press(self) -> None:
await self.coordinator.async_call(lambda client: client.reboot())