Commit graph

73 commits

Author SHA1 Message Date
Jan Bouwhuis
3112682923
Mark mqtt as integration with single config entry (#128202) 2024-10-12 19:55:39 +02:00
epenet
47a9dda3b8
Use root import in components (#125858) 2024-09-12 22:21:21 +02:00
Jan Bouwhuis
65216df3a5
Auto recover mqtt config entry secret if Mosquitto add-on was re-installed (#124514)
Auto recover mqtt config entry secret if Mosquitto add-on is re-installed
2024-08-26 09:40:25 +02:00
Jan Bouwhuis
61114d8328
Install and start Mosquitto MQTT broker add on from MQTT config flow (#124106)
* Opt in to install Mosquitto broker add-on in MQTT config flow

* rephrase

* Tests with supervisor and running add-on

* Complete tests for success flows

* Also set up entry in success flow

* Use realistic names for addon and broker

* Finetuning and fail test cases

* Spelling

* Improve translation strings

* Update addon docstr

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Raise AddonError if add-on does not start

* Only show the option to use the add-on

* Simplify flow, rework and cleanup

* Revert unrelated cleanup, process suggestion

* Move ADDON_SLUG const to addon module

* Move fixture to component level

* Move back supervisor fixture

* Move addon_setup_time_fixture and superfixe to config flow model tests

* Refactor hassio fixture

* Rename helpers as they are no fixtures, remove fixture from their names

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-22 09:07:45 +02:00
Jan Bouwhuis
a992654a8b
Fix blocking IO calls in mqtt client setup (#119647) 2024-06-13 17:47:38 -05:00
Jan Bouwhuis
9fd31f6c92
Correct stale docstring on mqtt config flow method (#116848) 2024-05-05 14:06:13 +02:00
Jan Bouwhuis
2ec9728edb
Cleanup unused class attr for MQTT config flow (#116653) 2024-05-02 23:09:16 +02:00
Jan Bouwhuis
18132916fa
Mask current password in MQTT option flow (#116098)
* Mask current password in MQTT option flow

* Update docstr

* Typo
2024-04-24 13:29:42 +02:00
Jan Bouwhuis
31d11b2362
Add re-auth flow for MQTT broker username and password (#116011)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-23 22:26:01 +02:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Sid
ccd2e989c3
Enable ruff RUF005 and fix occurrences (#113589) 2024-03-16 07:37:20 -10:00
Marc Mueller
59a6035d3f
Add empty line after module docstring [j-m] (#112700) 2024-03-08 09:01:29 -05:00
Erik Montnemery
52e7912caf
Migrate integrations i-m to generic flowhandler (#111863) 2024-02-29 20:08:46 +01:00
Jan Bouwhuis
20d0ebe3fa
Add TYPE_CHECKING condition on type assertions for mqtt (#100107)
Add TYPE_CHECKING condition on type assertions
2023-09-11 10:58:33 +02:00
Ville Skyttä
34b47a2597
Remove unnnecessary pylint configs from components [m-r]* (#98924) 2023-08-24 00:56:50 +02:00
Jan Bouwhuis
aab7dffdb9
Only expose MQTT advanced settings in advanced mode (#91996) 2023-04-25 22:23:17 +02:00
Jan Bouwhuis
aa68d1d617
Cleanup mqtt CONFIG_SCHEMA_ENTRY (#90791) 2023-04-11 17:41:38 +02:00
Jan Bouwhuis
14ffda9758
Remove dependency on async_setup from mqtt integration (#87987)
* Remove async_setup from mqtt integration

* Final update common tests

* Related tests init

* Related tests diagnostics

* Related tests config_flow

* Cleanup and correct test

* Keep websockets_api commands in async_setup
2023-03-28 09:37:07 +02:00
Jan Bouwhuis
57738fbb8c
Replace deprecated SSLContext constant PROTOCOL_TLS in mqtt (#88214)
Replace deprecated SSLContext constants
2023-02-16 13:01:28 -05:00
epenet
ba23816a0c
Inverse json import logic (#88099)
* Fix helpers and util

* Adjust components

* Move back errors

* Add report

* mypy

* mypy

* Assert deprecation messages

* Move test_json_loads_object

* Adjust tests

* Fix rebase

* Adjust pylint plugin

* Fix plugin

* Adjust references

* Adjust backup tests
2023-02-16 11:37:57 +01:00
Franck Nijhof
b7de185924
Fix CI, missing import in MQTT (#86517) 2023-01-24 11:40:40 +01:00
Jan Bouwhuis
42ca46d7b2
Remove redundant label for MQTT CA verification selector (#86236)
Remove redundant label for MQTT CA verification
2023-01-24 09:38:00 +01:00
Marc Mueller
077ca97ef8
Fix local_partial_types errors (#86410)
Fix local_partial_types errors
2023-01-23 10:29:11 +01:00
Jan Bouwhuis
66c3115b26
Improve MQTT transport select label (#86216) 2023-01-22 22:12:06 +01:00
Jan Bouwhuis
25392655e7
Allow translating select selector options (#85531)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-01-17 16:22:19 +01:00
Franck Nijhof
800b8abe39
Code styling tweaks to the MQTT integration (#85463) 2023-01-08 22:07:10 +01:00
Jan Bouwhuis
32d68f375b
Add Mqtt WebSockets support (#82078)
* Add Mqtt WebSockets support

* Fix tests

* Add testing websockets options

* Add tests transport settings

* Do not use templates for ws_headers

* Use json helper - small corrections
2022-11-23 15:03:31 +01:00
Jan Bouwhuis
b717da879f
Add support for Mqtt protocol version 5 (#82260) 2022-11-17 21:12:27 +01:00
Aarni Koskela
bbda122c99
Fix mqtt typo (#82086)
mqtt: fix "certiticate" typo
2022-11-14 16:22:23 +01:00
Jan Bouwhuis
7500d0c61c
Refactor MQTT_WILL_BIRTH_SCHEMA (#81879)
* Refactor MQTT_WILL_BIRTH_SCHEMA

* Refactor and move birth/will validation to utils

* Simplify birth will validation
2022-11-10 15:24:56 +01:00
Jan Bouwhuis
2d9f39d406
Strict typing for shared MQTT modules (#80913)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-10-26 13:52:34 +02:00
Jan Bouwhuis
5e7f571f01
Move advanced MQTT options to entry (#79351)
* 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
2022-10-24 09:58:23 +02:00
Jan Bouwhuis
65187ab227
Use selectors for basic broker and options for MQTT config flow (#79791)
Use selectors for basic broker en options
2022-10-11 10:51:35 +02:00
Jan Bouwhuis
6eb2c96d32
Correct use of ConfigType in MQTT config flow code (#79934)
Correct use of ConfigType
2022-10-09 14:41:30 +02:00
Jan Bouwhuis
aee82e2b3b
De-duplicate MQTT config_flow code (#79369)
* De-duplicate config_flow code

* De duplicate code birth and will
2022-10-07 10:12:19 +02:00
Jan Bouwhuis
84b2c74746
Move MQTT discovery hass.data globals to dataclass (#78706)
* Add MQTT discovery hass.data globals to dataclass

* isort

* Additional rework

* Add hass.data["mqtt_tags"] to dataclass

* Follow-up comment

* Corrections
2022-09-28 14:13:44 +02:00
Jan Bouwhuis
c5a58c8501
Fix MQTT setup after changing config entry flow options (#79103)
Fix issues with config flow options
2022-09-27 08:05:28 +02:00
epenet
e58531f118
Add MqttData helper to mqtt (#78825)
* Add MqttData helper to mqtt

* Adjust client for circular dependencies

* Move MqttData to models.py

* Move get_mqtt_data to util.py
2022-09-20 19:40:06 +02:00
Jan Bouwhuis
1f410e884a
Make hass.data["mqtt"] an instance of a DataClass (#77972)
* 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>
2022-09-17 21:43:42 +02:00
epenet
8ef87205f9
Improve type hints in mqtt (#74247) 2022-06-30 21:11:45 +02:00
epenet
f846cd033f
Add async_get_options_flow type hints (mqtt) (#73434) 2022-06-13 13:35:50 +02:00
Erik Montnemery
635d7085cf
Move MQTT config schemas and client to separate modules (#71995)
* Move MQTT config schemas and client to separate modules

* Update integrations depending on MQTT
2022-05-31 09:32:44 +02:00
Erik Montnemery
84243cf560
Tweak MQTT hassio discovery flow (#72699) 2022-05-30 14:25:36 +02:00
Erik Montnemery
e5523ef6b6
Correct local import of paho-mqtt (#67944)
* Correct local import of paho-mqtt

* Remove MqttClientSetup.mqtt class attribute

* Remove reference to MqttClientSetup.mqtt
2022-03-10 10:32:49 +01:00
Jan Bouwhuis
9356bf1a8e
Fix MQTT config flow with advanced parameters (#67556)
* Fix MQTT config flow with advanced parameters

* Add test
2022-03-03 21:40:15 +01:00
Jan Bouwhuis
845bf80e72
Mqtt improve test coverage (#66279)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-23 12:29:32 +01:00
Erik Montnemery
750b48dcaf
Use pylint disable-next in MQTT (#66758) 2022-02-17 11:12:12 -08:00
Erik Montnemery
fe38e6ba87
Drop MQTT import flow (#66160)
* Drop MQTT import flow

* Reload manually configured MQTT entities when config entry is setup

* Address review comments

* Actually remove the import flow
2022-02-10 21:09:57 +01:00
epenet
358922db56
Use dataclass for HassioServiceInfo (#60824)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-03 14:05:56 +01:00
Franck Nijhof
96303a1d80
Fix MQTT add-on discovery to be ignorable (#55250) 2021-08-26 11:14:42 +02:00