Code styling tweaks to the MQTT integration (#85463)

This commit is contained in:
Franck Nijhof 2023-01-08 22:07:10 +01:00 committed by GitHub
parent 1b592e6885
commit 800b8abe39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 152 additions and 80 deletions

View file

@ -69,7 +69,8 @@ PLATFORM_SCHEMA_MODERN = MQTT_RO_SCHEMA.extend(
}
).extend(MQTT_ENTITY_COMMON_SCHEMA.schema)
# Configuring MQTT Binary sensors under the binary_sensor platform key was deprecated in HA Core 2022.6
# Configuring MQTT Binary sensors under the binary_sensor platform key was deprecated in
# HA Core 2022.6
# Setup for the legacy YAML format was removed in HA Core 2022.12
PLATFORM_SCHEMA = vol.All(
warn_for_legacy_schema(binary_sensor.DOMAIN),
@ -83,7 +84,7 @@ async def async_setup_entry(
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up MQTT binary sensor through configuration.yaml and dynamically through MQTT discovery."""
"""Set up MQTT binary sensor through YAML and through MQTT discovery."""
setup = functools.partial(
_async_setup_entity, hass, async_add_entities, config_entry=config_entry
)