959 Commits

Author SHA1 Message Date
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
Jan Bouwhuis
4e7397dc9d
Test discovery subscriptions not done when discovery is disabled (#129458)
Test discovery subscriptions not performend when discovery is disabled
2024-10-30 14:38:44 +01:00
Robert Resch
380974eed4
Remove hassio from ALLOWED_USED_COMPONENTS and move some functions to helper (#127228)
* Remove hassio from ALLOWED_USED_COMPONENTS

* Move HassioServiceInfo to helpers.service_info

* Deprecate moved functions

* Add note about deprecation

* Fix tests

* Implement suggestion

* Typo

* Update pyproject.toml

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-10-30 12:43:41 +01:00
Mike Degatano
673f0224c9
Continue migration of methods from handler to aiohasupervisor (#129183) 2024-10-29 14:33:21 +01:00
Jan Bouwhuis
d237180a98
Allow re-discovery of mqtt integration config payloads (#127362) 2024-10-26 07:21:52 +02:00
Jan Bouwhuis
4b63829eef
Allow to set entity picture on mqtt entity platforms (#128404) 2024-10-25 20:16:11 +02:00
G Johansson
cdfec7ebb4
Implement new state property for alarm_control_panel which is using an enum (#126283)
* Alarm state from enum

* Fixes

* Set final

* Fix rebase

* Test const

* Fix breaking version

* Fix other for alarm_control_panel

* Fix integrations

* More

* More

* More

* More

* Fix zha

* Replace _attr_state

* Fix alarm_control_panel

* Fix tests

* Fixes

* Mods

* Change some

* More

* More

* More

* Tests

* Last tests

* Return enum

* Fix zha

* Remove not needed check

* Fix wording

* Fix homekit

* Mod prometheus

* Fix mypy

* Fix homekit

* Fix ifttt
2024-10-21 22:54:27 +02:00
Mike Degatano
ad55c9cc19
Remaining addon management to aiohasupervisor (#128484)
* Move set addon options to aiohasupervisor

* addon stats to aiohasupervisor and test fixes

* addon changelogs to aiohasupervisor

* Raise correct error for library in tests

* Cache client in instance property

* Use singleton method rather then HassIO instance method

* Mock supervisor client in more tests
2024-10-21 16:41:00 +02:00
Jan Bouwhuis
ac6d893758
Correct type hints on MQTT tests (#128299) 2024-10-16 13:49:18 +02:00
Jan Bouwhuis
3112682923
Mark mqtt as integration with single config entry (#128202) 2024-10-12 19:55:39 +02:00
G Johansson
666e8e133e
Cover state is enum (#127144)
* Change light state to use enum

* Adjust cover tests

* Update cover

* Fix covers

* Some tests

* More tests

* Fix tests

* Fix
2024-10-08 18:39:04 +02:00
Jan Bouwhuis
e54031e318
Improve mqtt sensor options validion logging (#127631)
* Improve mqtt sensor options validion logging

* Fix test
2024-10-05 13:31:42 +02:00
Jan Bouwhuis
f99b7d8b78
Start mqtt integration discovery config flow only once if config has not changed (#126966)
* Start mqtt integration config flow only once

* Remember last config message

* Filter out instead of unsubscribing the intehration discovery topic

* Follow up comments from code review
2024-09-30 12:44:40 +02:00
Jan Bouwhuis
b573e5a2b3
Allow null / None value for non numeric mqtt sensor without warnings (#127032)
Allow `null` / `None` value for mqtt sensor without warnings
2024-09-30 07:05:12 +02:00
Jan Bouwhuis
7fde2e2fe0
Do not unsubscribe mqtt integration discovery if entry is already configured (#126907)
* Do not unsubscribe mqtt integration discovery if entry is already configured

* Test cases without unsubscribe
2024-09-27 17:28:51 +02:00
Mike Degatano
7517948900
Replace more addon management with aiohasupervisor (#126236)
* Replace start_addon with library call

* restart_addon to library and error issues in tests

* stop_addon to library

* uninstall_addon to library

* Add output typing

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-09-24 15:47:29 +02:00
G Johansson
93aade6e8e
Change lock state to an enum (#126379)
* Add new LockState enum for lock states

* Add rest

* Fix insteon tests

* Fix mqtt tests

* Fix tesla_fleet

* Revert back ST_STATE_LOCKED

* Add back constant
2024-09-24 12:30:50 +02:00
G Johansson
939f2e41e9
Change valve state to an enum (#126428) 2024-09-23 14:20:18 +02:00
Jan Bouwhuis
21affac571
Rename mqtt mixins module to entity.py (#126279) 2024-09-19 20:50:33 +02:00
epenet
bd2b72235e
Use root import in tests (#125862)
* Use root import in components

* One more
2024-09-13 06:42:32 +02:00
Jan Bouwhuis
3889482f0e
Do not directy import platform DOMAIN const in MQTT platform tests (#125589) 2024-09-09 14:36:15 +02:00
Jan Bouwhuis
1cb9690001
Cleanup unused hass_storage mocks in mqtt tests (#124846) 2024-08-29 10:52:57 +02:00
epenet
57a73d1b1b
Use start_reauth helper method in integration tests (m-o) (#124790) 2024-08-28 16:19:31 +02:00
Jan Bouwhuis
e720a14dc4
Cleanup removed schema option from mqtt vacuum platform (#124722) 2024-08-28 07:49:05 +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
e13f8996f2
Fix Import ReceivePayloadType (#124431)
* Fix Import ReceivePayloadType

* Do not assert export `ReceivePayloadType` on mqtt integration level as helper should be used.
2024-08-22 20:13:30 +02:00
Jan Bouwhuis
7887bcba89
Allow to set options for an MQTT enum sensor (#123248)
* Add options attribute support for MQTT sensor

* Add comment
2024-08-22 19:16:08 +02:00
Michael Arthur
3a92899081
Add LawnMowerActivity.RETURNING to Lawn Mower (#124261)
* Add returning activity state

* update tests

* update tests

* set can return to returning state

* update MQTT tests

* update mqtt back to docked

* fix up other tests that I broke again

* re-add mower_can_dock
2024-08-22 19:13:54 +02:00
Jan Bouwhuis
b541d214ed
Fix lingering mqtt unload entry test (#124392) 2024-08-22 11:03:35 +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
b74aced6f3
Subscribe per component for MQTT discovery (#119974)
* Subscribe per component for MQTT discovery

* Use single assignment

* Handle wildcard subscriptions first

* Split subsRecription handling, update helper

* Fix help_all_subscribe_calls

* Fix import

* Fix test

* Update import order

* Undo move self._last_subscribe

* Recover removed test

* Revert not needed changes to binary_sensor platform tests

* Revert line removal

* Rework interation of discovery topics

* Reduce

* Add comment

* Move comment

* Chain subscriptions
2024-08-20 17:02:48 +02:00
Jan Bouwhuis
183c191d63
Allow raw mqtt payload to be in mqtt publish action (#123900)
* Publish raw rendered mqtt payload as raw for mqtt publish action

* Move check out of try block

* Only try to eval `bytes` is payload starts with supported string

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

* Improve docst

* Add `evaluate_bytes` option to publish action

* Rename to `evaluate_payload`

* Update homeassistant/components/mqtt/strings.json

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

* Extend test to assert literal_eval is called or not

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-16 13:34:14 +02:00
Jan Bouwhuis
21987a67e7
Cleanup unneeded assignment of hass property on MQTT Template objects (#123706)
* Cleanup unneeded assignment of hass property on MQTT Template objects

* Commented out code and unneeded checks

* Consistent assign hass to Template in mqtt tests

* Remove unused hass attribute

* Missed line
2024-08-12 19:20:21 +02:00
Maciej Bieniek
a9d8e47979
Support DeviceInfo.model_id in MQTT integration (#123152)
Add support for model_id
2024-08-04 23:02:41 +02:00
G Johansson
a913587eb6
Climate validate temperature(s) out of range (#118649)
* Climate temperature out of range

* Fix test sensibo

* use temp converting for min/max

* Fix

* Fix mqtt tests

* Fix honeywell tests

* Fix Balboa tests

* Fix whirlpool test

* Fix teslemetry test

* Fix plugwise test

* Fix tplink test

* Fix generic thermostat test

* Fix modbus test

* Fix fritzbox tests

* Honewell
2024-07-31 19:17:53 +02:00
epenet
fdab23c3f9
Fix implicit-return in test schema extractions (#122787) 2024-07-29 22:16:00 +02:00
Marc Mueller
c92d9dcb74
Use TypeVar defaults for Generator (#122170) 2024-07-19 13:06:45 +02:00
Jan Bouwhuis
16434b5306
Add command_template option to mqtt switch schema (#122103) 2024-07-19 12:10:49 +02:00
G Johansson
ca4c617d4b
Add TURN_OFF/TURN_ON feature flags for fan (#121447) 2024-07-19 11:35:24 +02:00
Jan Bouwhuis
5b4dd07189
Deprecate topic_template and payload_template for mqtt publish action (#122098)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-19 10:10:38 +02:00
Jan Bouwhuis
843fae825f
Revert "Remove stale template_topic code for mqtt publish service" (#121758)
Revert "Remove stale `template_topic` code for mqtt publish service (#121604)"

This reverts commit 5b25c24539c82cc3c014fde744a3f678e98890f0.
2024-07-17 17:56:34 +02:00
Jan Bouwhuis
acb4a92628
Revert "Add mqtt automation publish test with template rendering" (#121757) 2024-07-11 09:36:14 +02:00
Jan Bouwhuis
71e5ffb2bd
Add mqtt automation publish test with template rendering (#121695) 2024-07-10 21:17:27 +02:00
Jan Bouwhuis
5b25c24539
Remove stale template_topic code for mqtt publish service (#121604) 2024-07-09 18:22:08 +02:00
G Johansson
26bc37195e
Add defrosting as HVACAction in ClimateEntity (#121448) 2024-07-07 18:54:40 +02:00
J. Nick Koston
7002042119
Fix blocking I/O in mqtt tests (#121140) 2024-07-04 05:13:13 +01:00