mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Fix incorrect leagacy code tweak for MQTT (#96812)
Cleanup mqtt_data_updated_config
This commit is contained in:
parent
aa13082ce0
commit
0134ee9305
@ -336,7 +336,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Reload the platforms."""
|
||||
# Fetch updated manual configured items and validate
|
||||
config_yaml = await async_integration_yaml_config(hass, DOMAIN) or {}
|
||||
mqtt_data.updated_config = config_yaml.get(DOMAIN, {})
|
||||
mqtt_data.config = config_yaml.get(DOMAIN, {})
|
||||
|
||||
# Reload the modern yaml platforms
|
||||
mqtt_platforms = async_get_platforms(hass, DOMAIN)
|
||||
|
@ -307,12 +307,7 @@ async def async_setup_entry_helper(
|
||||
async def _async_setup_entities() -> None:
|
||||
"""Set up MQTT items from configuration.yaml."""
|
||||
mqtt_data = get_mqtt_data(hass)
|
||||
if mqtt_data.updated_config:
|
||||
# The platform has been reloaded
|
||||
config_yaml = mqtt_data.updated_config
|
||||
else:
|
||||
config_yaml = mqtt_data.config or {}
|
||||
if not config_yaml:
|
||||
if not (config_yaml := mqtt_data.config):
|
||||
return
|
||||
if domain not in config_yaml:
|
||||
return
|
||||
|
@ -313,4 +313,3 @@ class MqttData:
|
||||
state_write_requests: EntityTopicState = field(default_factory=EntityTopicState)
|
||||
subscriptions_to_restore: list[Subscription] = field(default_factory=list)
|
||||
tags: dict[str, dict[str, MQTTTagScanner]] = field(default_factory=dict)
|
||||
updated_config: ConfigType = field(default_factory=dict)
|
||||
|
Loading…
x
Reference in New Issue
Block a user