221 files
This commit is contained in:
@@ -17,6 +17,7 @@ from homeassistant.const import CONF_ID
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
|
||||
from ....const import DOMAIN as SPOOK_DOMAIN
|
||||
from ....services import AbstractSpookEntityComponentService
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -45,8 +46,13 @@ class SpookService(AbstractSpookEntityComponentService[Timer]):
|
||||
entity_id = entity.entity_id
|
||||
|
||||
if not entity.editable or not entity.unique_id:
|
||||
message = f"This timer is not editable: {entity_id}"
|
||||
raise HomeAssistantError(message)
|
||||
raise HomeAssistantError(
|
||||
translation_domain=SPOOK_DOMAIN,
|
||||
translation_key="timer_not_editable",
|
||||
translation_placeholders={
|
||||
"entity_id": entity_id,
|
||||
},
|
||||
)
|
||||
|
||||
# pylint: disable-next=protected-access
|
||||
updates = entity._config.copy() # noqa: SLF001
|
||||
|
||||
Reference in New Issue
Block a user