(hass: HomeAssistant, entry: ConfigEntry, yaml_config: ConfigType)
Update a config entry with the latest yaml.
Update a config entry with the latest yaml.
Update a config entry with the latest yaml .
def _async_update_config_entry_from_yaml(hass: HomeAssistant, entry: ConfigEntry, yaml_config: ConfigType):
    """Update a config entry with the latest yaml."""
    data = entry.data.copy()
    data.setdefault(const.CONF_CONNECTION_TYPE, const.CONNECTION_TYPE_DIRECT)
    if const.CONF_DEVICES_DISCOVERED not in data:  # pre-0.3 migration
        data.setdefault(const.CONF_DEVICES_DISCOVERED, True)
    data.setdefault(const.CONF_DEVICES_DISCOVERED, False)

    if DOMAIN in yaml_config:
        data.update(yaml_config[DOMAIN][const.CONF_SETTINGS])
        data.update({
            const.CONF_NOTIFIER: yaml_config[DOMAIN][const.CONF_NOTIFIER]
        })
    else:
        data.update(SETTINGS_SCHEMA(data={}))

    hass.config_entries.async_update_entry(entry, data=data)
def _async_update_config_entry_from_yaml ( hass : HomeAssistant , entry : ConfigEntry , yaml_config : ConfigType ) : data = entry . data . copy ( ) data . setdefault ( const . CONF_CONNECTION_TYPE , const . CONNECTION_TYPE_DIRECT ) if const . CONF_DEVICES_DISCOVERED not in data : # pre-0.3 migration data . setdefault ( const . CONF_DEVICES_DISCOVERED , True ) data . setdefault ( const . CONF_DEVICES_DISCOVERED , False ) if DOMAIN in yaml_config : data . update ( yaml_config [ DOMAIN ] [ const . CONF_SETTINGS ] ) data . update ( { const . CONF_NOTIFIER : yaml_config [ DOMAIN ] [ const . CONF_NOTIFIER ] } ) else : data . update ( SETTINGS_SCHEMA ( data = { } ) ) hass . config_entries . async_update_entry ( entry , data = data )