Deprecate onewire YAML configuration (#50151)

This commit is contained in:
epenet 2021-05-07 15:46:23 +02:00 committed by GitHub
parent d4601e00fd
commit dc29087416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,6 +236,11 @@ def get_sensor_types(device_sub_type):
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Old way of setting up 1-Wire platform."""
_LOGGER.warning(
"Loading 1-Wire via platform setup is deprecated. "
"Please remove it from your configuration"
)
if config.get(CONF_HOST):
config[CONF_TYPE] = CONF_TYPE_OWSERVER
elif config[CONF_MOUNT_DIR] == DEFAULT_SYSBUS_MOUNT_DIR: