* Do not write old state sharing availability topic
* Add a test
* Support for all availability topics
* delay async_write_ha_state till last callback
* Process write req after processing callback jobs
* Do not count subscription callbacks
* Simplify
* Stale docsting
* No topic needed for delays state write
* No need to clear when reloading
* Move test to test_mixins.py
* Only set up sensor platform for test
* Add MQTT debug_info to dataclass
* Remove total attr, assign factory
* Rename typed dict to MqttDebugInfo and use helper
* Split entity and trigger debug info
* Refactor
* More rework
* Use dataclass to reference hass.data globals
* Add discovery_registry_hooks to dataclass
* Move discovery registry hooks to dataclass
* Add device triggers to dataclass
* Cleanup DEVICE_TRIGGERS const
* Add last_discovery to data_class
* Simplify typing for class `Subscription`
* Follow up on comment
* Redo suggested typing change to sasisfy mypy
* Restore typing
* Add mypy version to CI check logging
* revert changes to ci.yaml
* Add docstr for protocol
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Mypy update after merging #78399
* Remove mypy ignore
* Correct return type
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Cleanup discovery on entity removal
* Add test
* Cleanup and test
* Test with clearing payload not unique id
* Address comments
* Tests cover and typing
* Just pass hass
* reuse code
* Follow up comments revert changes to cover tests
* Add test unique_id has priority over disabled
* Update homeassistant/components/mqtt/__init__.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Common tests availability
* Common tests attributes
* Common tests unique id
* Common tests discovery
* Common tests encoding
* Common tests device info
* Common tests entity_id updated
* Common tests entity debug info
* Common test entity category
* Common tests setup reload unload+corrections
* Cleanup sweep
* Comments from curent change
* Cleanup
* Remove unused legacy config
* Wait for unsubscribes
* Spelling comment
* Remove notify_all() during _register_mid()
* Update homeassistant/components/mqtt/client.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Correct handling reload manual set up MQTT items
* Save and restore device trigger subscriptions
* Clarify we are storing all remaining subscriptions
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Add `this` object to MQTT templates
* Only set once, remove hass guard
* Set once if there is a state
* Add tests TemplateStateFromEntityId calls once
* Remove deprecated white_value support from MQTT light
* Remove deprecated white_value support from MQTT JSON light
* Remove deprecated white_value support from MQTT template light
* Fix MQTT camera encoding
* Reduce code
* Add test for using image_encoding parameter
* Move deprecation check to validation
* Dependency
* Set correct strings and log warning
* Rename constant
* Use better issue string identifier
* Revert unwanted change to hassio test
* Avoid term `deprecated` in issue description
* Revert changes using the repairs API
* Add a notice when work-a-round will be removed
* Update homeassistant/components/mqtt/camera.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Speed up subscribing to mqtt topics
* update tests
* Remove extra function wrapper
* Recover debug logging for subscriptions
* Small changes and test
* Update homeassistant/components/mqtt/client.py
* Update client.py
Co-authored-by: jbouwh <jan@jbsoft.nl>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Ensure config schema validation
* Use correct schema for device_tracker
* Remove schema validation from the platform setup
* Remove loop to build schema