Improve handling of MQTT overridden settings (#72698)
* Improve handling of MQTT overridden settings * Don't warn unless config entry overrides yaml
This commit is contained in:
parent
42bcd0263c
commit
342ccb5bf1
2 changed files with 7 additions and 11 deletions
|
@ -685,9 +685,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
# User has configuration.yaml config, warn about config entry overrides
|
||||
elif any(key in conf for key in entry.data):
|
||||
shared_keys = conf.keys() & entry.data.keys()
|
||||
override = {k: entry.data[k] for k in shared_keys}
|
||||
override = {k: entry.data[k] for k in shared_keys if conf[k] != entry.data[k]}
|
||||
if CONF_PASSWORD in override:
|
||||
override[CONF_PASSWORD] = "********"
|
||||
if override:
|
||||
_LOGGER.warning(
|
||||
"Deprecated configuration settings found in configuration.yaml. "
|
||||
"These settings from your configuration entry will override: %s",
|
||||
|
|
|
@ -1715,11 +1715,6 @@ async def test_update_incomplete_entry(
|
|||
"The 'broker' option is deprecated, please remove it from your configuration"
|
||||
in caplog.text
|
||||
)
|
||||
assert (
|
||||
"Deprecated configuration settings found in configuration.yaml. These settings "
|
||||
"from your configuration entry will override: {'broker': 'yaml_broker'}"
|
||||
in caplog.text
|
||||
)
|
||||
|
||||
# Discover a device to verify the entry was setup correctly
|
||||
async_fire_mqtt_message(hass, "homeassistant/sensor/bla/config", data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue