Fix mqtt device_tracker is not reloading yaml (#90639)

pull/90455/head
Jan Bouwhuis 2023-04-01 21:17:53 +02:00 committed by GitHub
parent 8263c3de23
commit 9965d9d81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -113,6 +113,7 @@ RELOADABLE_PLATFORMS = [
Platform.CAMERA,
Platform.CLIMATE,
Platform.COVER,
Platform.DEVICE_TRACKER,
Platform.FAN,
Platform.HUMIDIFIER,
Platform.LIGHT,

View File

@ -10,10 +10,17 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.setup import async_setup_component
from .test_common import help_test_setting_blocked_attribute_via_mqtt_json_message
from .test_common import (
help_test_reloadable,
help_test_setting_blocked_attribute_via_mqtt_json_message,
)
from tests.common import async_fire_mqtt_message
from tests.typing import MqttMockHAClientGenerator, WebSocketGenerator
from tests.typing import (
MqttMockHAClientGenerator,
MqttMockPahoClient,
WebSocketGenerator,
)
DEFAULT_CONFIG = {
mqtt.DOMAIN: {
@ -603,3 +610,13 @@ async def test_setup_with_modern_schema(
dev_id = "jan"
entity_id = f"{device_tracker.DOMAIN}.{dev_id}"
assert hass.states.get(entity_id) is not None
async def test_reloadable(
hass: HomeAssistant,
mqtt_client_mock: MqttMockPahoClient,
) -> None:
"""Test reloading the MQTT platform."""
domain = device_tracker.DOMAIN
config = DEFAULT_CONFIG
await help_test_reloadable(hass, mqtt_client_mock, domain, config)