Commit Graph

1054 Commits

Author SHA1 Message Date
Jan Bouwhuis
bd4d0ec4b8 Add initial MQTT subentry support for notify entities (#138461)
* Add initial MQTT subentry support for notify entities

* Fix componts assigment is reset on device config. Translation tweaks

* Rephrase

* Go to summary menu when components are set up already - add test

* Fix suggested device info on config flow

* Invert

* Simplify subentry config flow and omit menu

* Use constants instead of literals

* More constants

* Teak some translations

* Only show save when the the entry is dirty

* Do not trigger an entry reload twice

* Remove encoding, entity_category

* Remove icon from mqtt subentry flow

* Separate entity settings and MQTT specific settings

* Remove object_id and refactor

* Migrate translations

* Make subconfig flow test extensible

* Make sub reconfig flow tests extensible

* Rename entity_platform_config step to mqtt_platform_config

* Make component unique ID independent from the name

* Move code for update of component data to helper

* Follow up on code review

* Skip dirty stuff

* Fix rebase issues #1

* Do not allow reconfig for entity platform/name, default QoS and refactor tests

* Add entity platform and entity name label to basic entity config dialog

* Rename to exclude_from_reconfig and make reconfig option not optional
2025-03-14 14:00:07 +01:00
epenet
593ae48aa2 Migrate mqtt tests to use unit system (#140376)
* Migrate mqtt tests to use unit system

* Fix param list

* Missed one

---------

Co-authored-by: jbouwh <jan@jbsoft.nl>
2025-03-12 09:47:34 +02:00
epenet
a13911e00e Rename test helpers module in mqtt (#140375)
* Rename test helpers module in mqtt

* missed a file
2025-03-11 18:00:51 +01:00
Jan Bouwhuis
6284a83a34 Fix client_id not generated when connecting to the MQTT broker (#140264)
Fix client_id not generated when connecting to the MQTT broker
2025-03-10 11:04:49 +01:00
Jan Bouwhuis
1a46edffaa Deprecate use of invalid unit of measurement for mqtt sensor (#140164)
* Deprecate use of invalid unit of measurement for mqtt sensor

* Update learn more URL to point to user docs instead

* typo
2025-03-09 14:20:31 +01:00
Jan Bouwhuis
0d3011f0fb Revert "Check if the unit of measurement is valid before creating the entity" (#140155)
Revert "Check if the unit of measurement is valid before creating the entity …"

This reverts commit 99e1a7a676.
2025-03-08 23:04:05 +01:00
Jan Bouwhuis
d94bdb7ecd Fix MQTT JSON light not reporting color temp status if color is not supported (#140113) 2025-03-08 09:15:56 -10:00
Jan Bouwhuis
99e1a7a676 Check if the unit of measurement is valid before creating the entity (#139932) 2025-03-06 18:52:46 +01:00
Jan Bouwhuis
913a4ee9ba Improve certificate handling in MQTT config flow (#137234)
* Improve mqtt broker certificate handling in config flow

* Expand test cases
2025-03-01 21:14:08 +01:00
Jan Bouwhuis
2de941bc11 Fix - Allow brightness only light MQTT json light to be set up using the brightness flag or via supported_color_modes (#139585)
* Fix - Allow brightness only light MQTT json light to be set up using the `brightness` flag or via  `supported_color_modes`

* Improve comment
2025-03-01 19:35:39 +01:00
Jan Bouwhuis
5324f3e542 Add support for swing horizontal mode for mqtt climate (#139303)
* Add support for swing horizontal mode for mqtt climate

* Fix import
2025-02-26 15:44:16 +01:00
Jan Bouwhuis
689421eddf Move blocking code to executor job in MQTT CI test helper (#138815) 2025-02-19 06:14:07 +01:00
skobow
f8ffbf0506 Set clean_start=True on connect to MQTT broker (#136026)
* Addresses #135443: Set  on connect.

* Make clean start implementation compatible with v2 API

* Add tests

* Do not pass default value for `clean_start` on_connect

* Revert "Do not pass default value for `clean_start` on_connect"

This reverts commit 75806736cf.

* Use partial top pass kwargs to mqtt client connect

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Co-authored-by: jbouwh <jan@jbsoft.nl>
2025-02-18 23:11:21 +01:00
Jan Bouwhuis
33df208296 Fix temp files of mqtt CI tests not cleaned up properly (#138741)
* Fix temp files of mqtt CI tests not cleaned up properly

* Do not cleanup tempfiles, patch gettempdir only
2025-02-18 08:38:43 +01:00
Jan Bouwhuis
d6b7762dd6 Upgrade paho-mqtt API to v2 (#137613)
* Upgrade paho-mqtt API to v2

* Refactor on_connect callback

* Add tests

* Fix Tasmota tests
2025-02-13 22:13:19 +01:00
Jan Bouwhuis
d3d00357aa Allow to omit the payload attribute to MQTT publish action to allow an empty payload to be sent by default (#137595)
Allow to omit the payload attribute to MQTT publish actionto allow an empty payload to be sent by default
2025-02-06 22:11:39 +02:00
Jan Bouwhuis
7fa6f7e875 Bump paho-mqtt client to version 2.1.0 (#136130)
* Bump paho-mqtt client to version 2.1.0

* Remove commented code

* Bump pyeconet==0.1.26

* Ensure types-paho-mqtt==1.6.0.20240321 is uninstalled if test requirements are updated

* Update roombapy dependency

* Remove pyeconet from exceptions list

* Revert changes to install test requirements task
2025-02-04 20:59:28 +01:00
Jan Bouwhuis
efc515ff4e Remove legacy color_mode support for legacy mqtt json light (#136996) 2025-02-04 12:34:36 +01:00
Marc Mueller
30c0a1492c Update codespell to 2.4.1 (#137312) 2025-02-04 12:16:24 +01:00
Jan Bouwhuis
30af9057d1 Ensure random temp dir is used during MQTT CI tests (#137221) 2025-02-03 16:06:02 +00:00
Jan Bouwhuis
839e2881e0 Fix mqtt reconfigure does not use broker entry password when it is not changed (#137169) 2025-02-02 16:21:40 +01:00
epenet
d0a188b86d Standardize homeassistant imports in component tests (m-z) (#136807) 2025-01-29 08:57:57 +01:00
Jan Bouwhuis
f0257fec88 Fix mqtt number state validation (#135621) 2025-01-15 10:13:27 +01:00
Jan Bouwhuis
b93aa760c5 Refactor the MQTT option and reconfigure flow (#133342)
* Move entry options to entry.options en remove broker setup from mqtt option flow

* UPdate diagnostics to export both entry data and options

* Parameterize entry options directly not depending on migration

* Update tests to use v2 entry and add separate migration test

* use start_reconfigure_flow helper

* Update quality scale comment

* Do minor entry upgrade, and do not force to upgrade entry

* Ensure options are read from older entries

* Add comment

* Follow up on code review

* Assert config entry version checking the broker connection

* Update comment
2025-01-13 19:00:18 +01:00
Jan Bouwhuis
eba090c9ef Allow to process kelvin as color_temp for mqtt template light (#133957) 2025-01-10 11:43:36 +01:00
epenet
02956f9a83 Improve formatting in component test files (#135267)
Improve formatting in test files
2025-01-10 10:53:45 +01:00
Jan Bouwhuis
cabdae98e8 Allow to process kelvin as color_temp for mqtt json light (#133955) 2025-01-09 18:34:42 +01:00
Jan Bouwhuis
ec37e1ff8d Allow to process kelvin as color_temp for mqtt basic light (#133953) 2025-01-09 16:31:09 +01:00
Jan Bouwhuis
85c94e6403 Calculate number of discovery topics correctly (#134393) 2025-01-01 16:55:41 +01:00
Jan Bouwhuis
8098122dfe Ensure an entity platform is added in mqtt tests (#134331) 2024-12-31 23:01:55 +01:00
Jan Bouwhuis
7b2a5d0684 Remove mqtt publish templates after 6 months of deprecation (#134056) 2024-12-26 23:25:44 +01:00
Jan Bouwhuis
6b666b3a0f Test color_temp updates are processed when an mqtt json light is turned off (#133715) 2024-12-21 12:44:00 +01:00
J. Nick Koston
4e316429d3 Handle WebsocketConnectionError during mqtt auto reconnect (#133697)
followup to #133610 to handle the exception in the auto reconnect
path as well

fixes #132985
2024-12-21 11:18:47 +01:00
J. Nick Koston
551a584ca6 Handle mqtt.WebsocketConnectionError when connecting to the MQTT broker (#133610)
fixes #132985
2024-12-19 21:39:39 +01:00
Jan Bouwhuis
ac6d718094 Fix mqtt reconfigure flow (#133315)
* FIx mqtt reconfigure flow

* Follow up on code review
2024-12-17 09:37:46 +01:00
Jan Bouwhuis
2003fc7ae0 Adjust MQTT tests not to assert on deprecated color_temp attribute (#133198) 2024-12-15 19:42:54 +01:00
Jan Bouwhuis
16ad2d52c7 Improve MQTT json color_temp validation (#133174)
* Improve MQTT json color_temp validation

* Revert unrelated changes and assert on logs

* Typo
2024-12-15 13:07:10 +01:00
Jan Bouwhuis
73cb3fa88d Fix lingering mqtt device_trigger unload entry test (#133202) 2024-12-15 11:55:33 +01:00
Jan Bouwhuis
97da8481d2 Add reconfigure flow to MQTT (#132246)
* Add reconfigure flow for MQTT integration

* Add test and translation strings

* Update quality scale configuration

* Do not cache ConfigEntry in flow

* Make sorce condition explictit

* Rework from suggested changes

* Do not allow reconfigure_entry and reconfigure_entry_data to be `None`
2024-12-13 16:11:45 +01:00
epenet
2ce2765e67 Adjust light test helpers to use Kelvin, and cleanup unused helpers (#133048)
Cleanup light test helper methods
2024-12-12 16:49:25 +01:00
epenet
33c799b2d0 Migrate mqtt light tests to use Kelvin (#133035) 2024-12-12 16:42:10 +01:00
epenet
0d71828def Migrate mqtt lights to use Kelvin (#132828)
* Migrate mqtt lights to use Kelvin

* Adjust restore_cache tests

* Adjust tests
2024-12-11 16:11:14 +01:00
G Johansson
2eaf206562 Implement new state property for vacuum which is using an enum (#126353)
* Implement new state property for vacuum which is using an enum

* Mod

* Mod init

* Mods

* Fix integrations

* Tests

* Fix state

* Add vacuum tests

* Fix last test

* Litterrobot tests

* Fixes

* Tests

* Fixes

* Fix VacuumEntity

* Mods

* Mods

* Mods

* Update demo

* LG

* Fix vacuum

* Fix Matter

* Fix deprecation version

* Mods

* Fixes

* Fix ruff

* Fix tests

* Fix roomba

* Fix breaking dates
2024-12-06 11:16:03 +01:00
Jan Bouwhuis
8f43a71ff6 Ensure MQTT subscriptions can be made when the broker is disconnected (#132270) 2024-12-04 15:18:04 +01:00
Jan Bouwhuis
a6cb6fd239 Create MQTT device referenced by via device (#131588) 2024-11-27 18:12:46 +01:00
Jan Bouwhuis
3474642afe Set up MQTT websocket_api and dump, publish actions from async_setup (#131170)
* Set up MQTT websocket_api and dump, publish actions from `async_setup`

* Follow up comments
2024-11-21 17:29:59 +01:00
Petar Petrov
c68cadad7a Improve precision of HSV color conversion (#130880) 2024-11-19 22:06:57 +01:00
Erik Montnemery
4ac35d40cd Fix create flow logic for single config entry integrations (#129807)
* Fix create flow logic for single config entry integrations

* Adjust MQTT test
2024-11-04 15:45:29 +01:00
Jan Bouwhuis
9fbd484dfe Add progress support to MQTT update platform (#129468)
* Add progress support to MQTT update platform and add validation on state updates

* Clean up cast to type class

* Add support for display_precision attribute
2024-10-30 17:22:55 +01:00
Jan Bouwhuis
1773f2aadc Allow MQTT device based auto discovery (#118757)
* Allow MQTT device based auto discovery

* Fix merge error

* Remove unused import

* Fix discovery device based topics

* Fix cannot delete twice

* Improve cleanup test

* Follow up comment

* Typo

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

* Explain more

* Use tuple

* Default a device payload to have priority over a platform based payload

* Add unique_id to sensor test data

* Set migration flag to mark a discovery topic for migration

* Correct type hint

* Make unique_id required for components in device based discovery payload

* Remove CONF_MIGRATE_DISCOVERY from platform schema

* Unload discovered MQTT item to allow migration

* Follow up comments from code review

* ruff

* Subscribe to platform discovery wildcards first

* Use normal dict

* Use dict to persist wildcard subscription order

* Remove missed unused parameter

* Add a comment to explain we use a dict  to preserve the subscription order

* Add wildcard subscription order test

* Remove discovery flag from test

* Improve discovery migration origin logging

* Assert initial  wildcard discovery topics subscription order and after reconnect

* Improve log messages

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-10-30 17:10:15 +01:00