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 Franck Nijhof
parent cfbc2ed437
commit 08382204a3
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 22 additions and 1 deletions

View File

@ -76,6 +76,7 @@ from .const import ( # noqa: F401
MQTT_DISCONNECTED,
MQTT_RELOADED,
PLATFORMS,
RELOADABLE_PLATFORMS,
)
from .models import ( # noqa: F401
MqttCommandTemplate,
@ -378,7 +379,7 @@ async def async_setup_entry( # noqa: C901
# 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,
]