Rework MQTT config merging and adding defaults (#90529)

* Cleanup config merging and adding defaults

* Optimize and update tests

* Do not mix entry and yaml config

* Make sure hass.data is initilized

* remove check on get_mqtt_data

* Tweaks to MQTT client

* Remove None assigment mqtt client and fix mock
This commit is contained in:
Jan Bouwhuis 2023-04-04 18:12:18 +02:00 committed by GitHub
parent 690a0f34e5
commit 4a0d3e881a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 77 additions and 180 deletions

View file

@ -288,8 +288,8 @@ class EntityTopicState:
class MqttData:
"""Keep the MQTT entry data."""
client: MQTT | None = None
config: ConfigType | None = None
client: MQTT
config: ConfigType
debug_info_entities: dict[str, EntityDebugInfo] = field(default_factory=dict)
debug_info_triggers: dict[tuple[str, str], TriggerDebugInfo] = field(
default_factory=dict