From 7a46e04fd195f5d19f11c82735efdf7d226e3957 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 26 Dec 2021 23:12:02 -1000 Subject: [PATCH] Remove unused homekit.start service (#62827) --- homeassistant/components/homekit/__init__.py | 21 ------------------- homeassistant/components/homekit/const.py | 1 - .../components/homekit/services.yaml | 4 ---- 3 files changed, 26 deletions(-) diff --git a/homeassistant/components/homekit/__init__.py b/homeassistant/components/homekit/__init__.py index 503a76418a9..02232aee1e8 100644 --- a/homeassistant/components/homekit/__init__.py +++ b/homeassistant/components/homekit/__init__.py @@ -91,7 +91,6 @@ from .const import ( MANUFACTURER, PERSIST_LOCK, SERVICE_HOMEKIT_RESET_ACCESSORY, - SERVICE_HOMEKIT_START, SERVICE_HOMEKIT_UNPAIR, SHUTDOWN_TIMEOUT, ) @@ -418,26 +417,6 @@ def _async_register_events_and_services(hass: HomeAssistant): schema=UNPAIR_SERVICE_SCHEMA, ) - async def async_handle_homekit_service_start(service): - """Handle start HomeKit service call.""" - tasks = [] - for homekit in _async_all_homekit_instances(hass): - if homekit.status == STATUS_RUNNING: - _LOGGER.debug("HomeKit is already running") - continue - if homekit.status != STATUS_READY: - _LOGGER.warning( - "HomeKit is not ready. Either it is already starting up or has " - "been stopped" - ) - continue - tasks.append(homekit.async_start()) - await asyncio.gather(*tasks) - - hass.services.async_register( - DOMAIN, SERVICE_HOMEKIT_START, async_handle_homekit_service_start - ) - async def _handle_homekit_reload(service): """Handle start HomeKit service call.""" config = await async_integration_yaml_config(hass, DOMAIN) diff --git a/homeassistant/components/homekit/const.py b/homeassistant/components/homekit/const.py index 1dd40d0fa31..63357fe2cf9 100644 --- a/homeassistant/components/homekit/const.py +++ b/homeassistant/components/homekit/const.py @@ -92,7 +92,6 @@ DEFAULT_HOMEKIT_MODE = HOMEKIT_MODE_BRIDGE HOMEKIT_MODES = [HOMEKIT_MODE_BRIDGE, HOMEKIT_MODE_ACCESSORY] # #### HomeKit Component Services #### -SERVICE_HOMEKIT_START = "start" SERVICE_HOMEKIT_RESET_ACCESSORY = "reset_accessory" SERVICE_HOMEKIT_UNPAIR = "unpair" diff --git a/homeassistant/components/homekit/services.yaml b/homeassistant/components/homekit/services.yaml index 68e7804697b..a982e9ccf8d 100644 --- a/homeassistant/components/homekit/services.yaml +++ b/homeassistant/components/homekit/services.yaml @@ -1,9 +1,5 @@ # Describes the format for available HomeKit services -start: - name: Start - description: Starts the HomeKit driver - reload: name: Reload description: Reload homekit and re-process YAML configuration