3232from homeassistant .core import HomeAssistant , callback
3333from homeassistant .exceptions import TemplateError
3434from homeassistant .helpers import config_validation as cv , selector , template
35- from homeassistant .helpers .device import async_device_info_to_link_from_device_id
36- from homeassistant .helpers .entity import async_generate_entity_id
3735from homeassistant .helpers .entity_platform import (
3836 AddConfigEntryEntitiesCallback ,
3937 AddEntitiesCallback ,
4240from homeassistant .helpers .script import Script
4341from homeassistant .helpers .typing import ConfigType , DiscoveryInfoType
4442
45- from .const import CONF_OBJECT_ID , DOMAIN
43+ from .const import DOMAIN
4644from .coordinator import TriggerUpdateCoordinator
4745from .entity import AbstractTemplateEntity
4846from .helpers import async_setup_template_platform
@@ -213,6 +211,8 @@ class AbstractTemplateAlarmControlPanel(
213211):
214212 """Representation of a templated Alarm Control Panel features."""
215213
214+ _entity_id_format = ENTITY_ID_FORMAT
215+
216216 # The super init is not called because TemplateEntity and TriggerEntity will call AbstractTemplateEntity.__init__.
217217 # This ensures that the __init__ on AbstractTemplateEntity is not called twice.
218218 def __init__ (self , config : dict [str , Any ]) -> None : # pylint: disable=super-init-not-called
@@ -363,12 +363,8 @@ def __init__(
363363 unique_id : str | None ,
364364 ) -> None :
365365 """Initialize the panel."""
366- TemplateEntity .__init__ (self , hass , config = config , unique_id = unique_id )
366+ TemplateEntity .__init__ (self , hass , config , unique_id )
367367 AbstractTemplateAlarmControlPanel .__init__ (self , config )
368- if (object_id := config .get (CONF_OBJECT_ID )) is not None :
369- self .entity_id = async_generate_entity_id (
370- ENTITY_ID_FORMAT , object_id , hass = hass
371- )
372368 name = self ._attr_name
373369 if TYPE_CHECKING :
374370 assert name is not None
@@ -379,11 +375,6 @@ def __init__(
379375 self .add_script (action_id , action_config , name , DOMAIN )
380376 self ._attr_supported_features |= supported_feature
381377
382- self ._attr_device_info = async_device_info_to_link_from_device_id (
383- hass ,
384- config .get (CONF_DEVICE_ID ),
385- )
386-
387378 async def async_added_to_hass (self ) -> None :
388379 """Restore last state."""
389380 await super ().async_added_to_hass ()
@@ -434,11 +425,6 @@ def __init__(
434425 self .add_script (action_id , action_config , name , DOMAIN )
435426 self ._attr_supported_features |= supported_feature
436427
437- self ._attr_device_info = async_device_info_to_link_from_device_id (
438- hass ,
439- config .get (CONF_DEVICE_ID ),
440- )
441-
442428 async def async_added_to_hass (self ) -> None :
443429 """Restore last state."""
444430 await super ().async_added_to_hass ()
0 commit comments