456 files

This commit is contained in:
Home Assistant Version Control
2026-10-01 05:38:21 +00:00
parent 4192ecbaae
commit 5d6d845ebf
456 changed files with 64951 additions and 3828 deletions
@@ -2,44 +2,12 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.components.input_number import DOMAIN
from homeassistant.components.input_number import (
DOMAIN,
InputNumber,
NumberStorageCollection,
)
from homeassistant.exceptions import HomeAssistantError
from ....services import AbstractSpookEntityComponentService
if TYPE_CHECKING:
from homeassistant.core import ServiceCall
from ....helper_collections import AbstractSpookDeleteHelperService
class SpookService(AbstractSpookEntityComponentService[InputNumber]):
"""Input number service to delete a helper on the fly."""
class SpookService(AbstractSpookDeleteHelperService):
"""Input number service to delete input numbers on the fly."""
domain = DOMAIN
service = "delete"
schema = {}
async def async_handle_service(
self,
entity: InputNumber,
call: ServiceCall, # noqa: ARG002
) -> None:
"""Handle the service call."""
if not entity.editable:
message = f"This input number is not editable: {entity.entity_id}"
raise HomeAssistantError(message)
collection: NumberStorageCollection
if DOMAIN in self.hass.data:
collection = self.hass.data[DOMAIN]
else:
# Major hack to get around edge cases. 👻
collection = self.hass.data["websocket_api"]["input_number/list"][
0
].__self__.storage_collection
await collection.async_delete_item(entity.unique_id)