Remove legacy YAML support from MQTT (#82102)
This commit is contained in:
parent
f82c4c7633
commit
7c2e7863d2
46 changed files with 54 additions and 1613 deletions
|
@ -43,7 +43,6 @@ from .mixins import (
|
|||
MqttAvailability,
|
||||
MqttEntity,
|
||||
async_setup_entry_helper,
|
||||
async_setup_platform_helper,
|
||||
warn_for_legacy_schema,
|
||||
)
|
||||
from .models import MqttValueTemplate, ReceiveMessage
|
||||
|
@ -71,31 +70,14 @@ PLATFORM_SCHEMA_MODERN = MQTT_RO_SCHEMA.extend(
|
|||
).extend(MQTT_ENTITY_COMMON_SCHEMA.schema)
|
||||
|
||||
# Configuring MQTT Binary sensors under the binary_sensor platform key is deprecated in HA Core 2022.6
|
||||
# Setup for the legacy YAML format was removed in HA Core 2022.12
|
||||
PLATFORM_SCHEMA = vol.All(
|
||||
cv.PLATFORM_SCHEMA.extend(PLATFORM_SCHEMA_MODERN.schema),
|
||||
warn_for_legacy_schema(binary_sensor.DOMAIN),
|
||||
)
|
||||
|
||||
DISCOVERY_SCHEMA = PLATFORM_SCHEMA_MODERN.extend({}, extra=vol.REMOVE_EXTRA)
|
||||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up MQTT binary sensor configured under the fan platform key (deprecated)."""
|
||||
# Deprecated in HA Core 2022.6
|
||||
await async_setup_platform_helper(
|
||||
hass,
|
||||
binary_sensor.DOMAIN,
|
||||
discovery_info or config,
|
||||
async_add_entities,
|
||||
_async_setup_entity,
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue