* Improve type hints light base
* improve type hints light schema basic
* Improve type hints light schema json
* Use MQTT Template models with light template
* Addtional type hints for template light
* Improve template hints for schema template
* Use strict type hints for templates
* MyPy corrections
* Follow up comments
* Follow up comments
* Revert changes schema_json
* Revert changes schema template
* Hints setup_entity_json and setup_entity_template
* Remove type hint on setup_entity JSON
* Improve type hints vacuum __init__ and schema
* Improve type hints and refactor templates legacy
* Improve type hints state vacuum
* Add hint for template parameters
* Apply suggestions from code review
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Some corrections
* Remove stale constant
* Use bitwise and
* Follow-up comment
* Remove incorrect type hint
* Remove asserts
* Cleanup asserts and reduce code
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
fix: late-import MQTTMessage
`paho-mqtt` is not listed in main requirements and is imported early by `conftest`.
Import it late to avoid an ImportError.
Split out from #81678.
* Improve typing siren
* Improve typing switch
* Set siren type hints at class level
* Set switch type hints at class level
* Follow up comment
* Improve hints on siren templates
* Another cleanup for siren
* Follow up comment
* Follow up comment
* Improve typing humidifier
* Improve typing lock
* Improve typing number
* Set humidifier type hints at class level
* Set lock type hints at class level
* Set number type hints at class level
* Some small updates
* Follow up comment
* Remove assert
* Improve typing debug_info
* Improve typing device_automation
* Improve typing device_trigger
* Improve typing fan
* Additional type hints device_trigger
* Set fan type hints to class level
* Cleanup and mypy
* Follow up and missed hint
* Follow up comment
* Improve typing device_tracker discovery
* Improve typing device_tracker yaml
* Add test source_type attribute
* Follow up comment
* Initialize at `__init__` not at class level.
* Use full name for return variable
* Correct import, remove assert
* Use AsyncSeeCallback
* Move advanced broker settings to entry
* Add repair issue for deprecated settings
* Split CONFIG_SCHEMA
* Do not store certificate UI flags in entry
* Keep entered password in next dialog
* Do not process yaml config in flow
* Correct typo
* Add websocket type hints in components
* Adjust
* Apply suggestion
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* 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>
* 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>