mirror of
https://github.com/home-assistant/core.git
synced 2025-11-16 06:20:07 +00:00
Adopt new runtime entry data model for AlarmDecoder (#117856)
* Adopt new runtime entity data model for AlarmDecoder Transition the AlarmDecoder integration to the new runtime entity model. * Apply change suggestions by epenet Tested & applied the suggestions from epenet.
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
"""Support for AlarmDecoder sensors (Shows Panel Display)."""
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DATA_AD, DOMAIN, SIGNAL_PANEL_MESSAGE
|
||||
from . import AlarmDecoderConfigEntry
|
||||
from .const import SIGNAL_PANEL_MESSAGE
|
||||
from .entity import AlarmDecoderEntity
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
hass: HomeAssistant,
|
||||
entry: AlarmDecoderConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up for AlarmDecoder sensor."""
|
||||
|
||||
client = hass.data[DOMAIN][entry.entry_id][DATA_AD]
|
||||
entity = AlarmDecoderSensor(client=client)
|
||||
entity = AlarmDecoderSensor(client=entry.runtime_data.client)
|
||||
async_add_entities([entity])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user