1
mirror of https://github.com/home-assistant/core synced 2024-07-18 12:02:20 +02:00

Don't attempt to reload MQTT device tracker (#73577)

This commit is contained in:
Erik Montnemery 2022-06-20 10:26:50 +02:00 committed by GitHub
parent 9680a367c8
commit cd08f1d0c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View File

@ -80,6 +80,7 @@ from .const import ( # noqa: F401
MQTT_DISCONNECTED,
MQTT_RELOADED,
PLATFORMS,
RELOADABLE_PLATFORMS,
)
from .models import ( # noqa: F401
MqttCommandTemplate,
@ -380,7 +381,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# Setup reload service. Once support for legacy config is removed in 2022.9, we
# should no longer call async_setup_reload_service but instead implement a custom
# service
await async_setup_reload_service(hass, DOMAIN, PLATFORMS)
await async_setup_reload_service(hass, DOMAIN, RELOADABLE_PLATFORMS)
async def _async_reload_platforms(_: Event | None) -> None:
"""Discover entities for a platform."""

View File

@ -92,3 +92,23 @@ PLATFORMS = [
Platform.SWITCH,
Platform.VACUUM,
]
RELOADABLE_PLATFORMS = [
Platform.ALARM_CONTROL_PANEL,
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.CAMERA,
Platform.CLIMATE,
Platform.COVER,
Platform.FAN,
Platform.HUMIDIFIER,
Platform.LIGHT,
Platform.LOCK,
Platform.NUMBER,
Platform.SELECT,
Platform.SCENE,
Platform.SENSOR,
Platform.SIREN,
Platform.SWITCH,
Platform.VACUUM,
]