Do not fail MQTT setup if events or sensors configured via yaml can't be validated (#102309)

* Add event and sensor

* Cleanup unused code

* Schema cannot be None for supported platform
This commit is contained in:
Jan Bouwhuis 2023-10-20 12:09:52 +02:00 committed by GitHub
parent f85b4f734c
commit 7d9014ae41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 44 additions and 95 deletions

View file

@ -14,10 +14,6 @@ from homeassistant.const import (
)
from homeassistant.helpers import config_validation as cv
from . import (
event as event_platform,
sensor as sensor_platform,
)
from .const import (
CONF_BIRTH_MESSAGE,
CONF_BROKER,
@ -41,10 +37,7 @@ CONFIG_SCHEMA_BASE = vol.Schema(
Platform.CLIMATE.value: vol.All(cv.ensure_list, [dict]),
Platform.COVER.value: vol.All(cv.ensure_list, [dict]),
Platform.DEVICE_TRACKER.value: vol.All(cv.ensure_list, [dict]),
Platform.EVENT.value: vol.All(
cv.ensure_list,
[event_platform.PLATFORM_SCHEMA_MODERN], # type: ignore[has-type]
),
Platform.EVENT.value: vol.All(cv.ensure_list, [dict]),
Platform.FAN.value: vol.All(cv.ensure_list, [dict]),
Platform.HUMIDIFIER.value: vol.All(cv.ensure_list, [dict]),
Platform.IMAGE.value: vol.All(cv.ensure_list, [dict]),
@ -54,10 +47,7 @@ CONFIG_SCHEMA_BASE = vol.Schema(
Platform.NUMBER.value: vol.All(cv.ensure_list, [dict]),
Platform.SCENE.value: vol.All(cv.ensure_list, [dict]),
Platform.SELECT.value: vol.All(cv.ensure_list, [dict]),
Platform.SENSOR.value: vol.All(
cv.ensure_list,
[sensor_platform.PLATFORM_SCHEMA_MODERN], # type: ignore[has-type]
),
Platform.SENSOR.value: vol.All(cv.ensure_list, [dict]),
Platform.SIREN.value: vol.All(cv.ensure_list, [dict]),
Platform.SWITCH.value: vol.All(cv.ensure_list, [dict]),
Platform.TEXT.value: vol.All(cv.ensure_list, [dict]),