Commit Graph

1221 Commits (3d9d79684df5724a1a7e3b77e647f4d9e646eeba)

Author SHA1 Message Date
Jan Bouwhuis 666aace8a2
Complete partly implemented type hints for `dict` on MQTT platforms (#87839) 2023-02-12 21:47:38 +01:00
Jan Bouwhuis 71b67e20e4
Improve MQTT `Callable` type hints (#87838) 2023-02-12 21:24:59 +01:00
J. Nick Koston 1a35c2d805
Avoid creating a task when waiting for the MQTT mid (#87887) 2023-02-12 14:24:55 -06:00
J. Nick Koston f2fb6a9a60
Optimize mqtt matchers (#87853) 2023-02-12 14:24:35 -06:00
J. Nick Koston 753c7abaf4
Make mqtt websocket subscribe use callback functions (#87885)
Nothing was being awaited so this was needlessly generating tasks when the callbacks fired
2023-02-12 21:05:37 +01:00
J. Nick Koston 1d4d688af3
Make mqtt discovery use callback functions (#87883) 2023-02-12 20:41:03 +01:00
Jan Bouwhuis 1a38b9f665
Improve coverage MQTT device_trigger (#87408)
* Improve coverage MQTT device_trigger

* Use assert
2023-02-09 17:42:32 +01:00
Erik Montnemery 1d64ba9d34
Sort manifests 6 (#87027) 2023-02-08 20:38:43 +01:00
epenet a202588fd2
Add return type to json_loads (#85672)
* Add JSON type definitions

* Sample use

* Keep mutable for a follo-up PR (avoid dead code)

* Use list/dict

* Remove JsonObjectType

* Remove reference to Union

* Cleanup

* Improve rest

* Rename json_dict => json_data

* Add docstring

* Add type hint to json_loads

* Add cast

* Move type alias to json helpers

* Cleanup

* Create and use json_loads_object

* Make error more explicit and add tests

* Use JsonObjectType in conversation

* Remove quotes
2023-02-07 17:21:55 +01:00
Jan Bouwhuis 4aa61b0d64
Cleanup remains of legacy validation MQTT light (#87467) 2023-02-07 14:52:40 +01:00
Jan Bouwhuis be564e0162
Cleanup `value_template` config parameter from MQTT basic light (#87466)
* Remove not supported case from code for MQTT light

* Remove from schema
2023-02-07 13:05:24 +01:00
Jan Bouwhuis c78cae4483
Fix handling `None` or empty value for numeric MQTT sensor (#87004)
* Allow `None` for numeric sensor, ignore empty val

* Add test case with omitting a value

* Use _numeric_state_expected property

* Only respect None if numeric state is expected
2023-02-07 11:23:23 +01:00
Jan Bouwhuis 73e3b30906
Add `suggested_display_precision` config option for MQTT sensor (#87129)
* Add precision for MQTT sensor

* Correct tests

* Use _attr_suggested_display_precision

* Rename option and add abbreviation

* Make abbr more compact
2023-02-07 08:55:35 +01:00
Marc Mueller 4fbb14ecc7
Update mypy to 1.0.0 (#87586) 2023-02-07 02:31:14 +01:00
Franck Nijhof 939eef3b28
Remove translations from Core (#87543)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-06 15:06:43 +01:00
Jan Bouwhuis 212e172be2
Cleanup not used schema validator for MQTT vacuum (#87462)
* Cleanup not used schema validator for MTT vacuum

* Only leave warning
2023-02-06 13:34:36 +01:00
Franck Nijhof 28b6306ad6
Remove use of Number DEVICE_CLASSES_SCHEMA from MQTT (#87345) 2023-02-04 00:08:15 +01:00
Franck Nijhof fcb612cd6f
Collection of code styling tweaks (#87344) 2023-02-03 23:51:27 +01:00
Franck Nijhof ca1a12898c
Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
epenet 810367b757
Fix `can not` typo (#87254) 2023-02-03 11:37:16 +01:00
Franck Nijhof 5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
GitHub Action 0f80932709 [ci skip] Translation update 2023-02-02 00:25:01 +00:00
Jan Bouwhuis 33ede351f0
Cleanup code for parsing yaml MQTT config (#86944)
* Cleanup code for parsing yaml configs

* Add abstractmethod decorator to async_update

* Replace get() with default-list ensured by schema
2023-01-31 08:24:33 +01:00
Jan Bouwhuis e57dad79fc
Fix MQTT discovery failing after bad config update (#86935)
* Fix MQTT discovery failing after bad config update

* Update last discovery payload after update success

* Improve test, correct update assignment

* send_discovery_done to finally-catch vol.Error

* Just use try..finally

* Remove extra line

* use elif to avoid log confusion
2023-01-30 19:15:11 +01:00
Jan Bouwhuis 6a94a58325
Correct stale doc string for MQTT tag platform (#86862) 2023-01-29 00:23:22 +02:00
Franck Nijhof e738924780
Enable Ruff SIM105 (#86759)
* Enable Ruff SIM105

* Adjust existing cases
2023-01-26 21:06:22 -05: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
GitHub Action 613aa6f43a [ci skip] Translation update 2023-01-24 00:24:57 +00:00
Jan Bouwhuis 8672be3829
Always add `code` to template vars MQTT lock command template (#86460)
Always add `code` to template vars lock cmd tpl
2023-01-23 16:08:25 +01:00
Marc Mueller 6f94e47270
Update Union typing (6) [Py310] (#86454) 2023-01-23 15:01:07 +01:00
Jan Bouwhuis f719ecf086
Add command template and code_format support for MQTT lock (#85830)
* Add command template for MQTT lock

* Fix tests
2023-01-23 14:48:07 +01:00
Marc Mueller 077ca97ef8
Fix `local_partial_types` errors (#86410)
Fix local_partial_types errors
2023-01-23 10:29:11 +01:00
Marc Mueller 8abce25948
Update Union typing (4) [Py310] (#86427) 2023-01-23 09:04:40 +01:00
Marc Mueller d7dda6bee5
Update python version used for pylint [Py310] (#86414)
* Update python version used for pylint linting [Py310]

* Import Callable from collections.abc [Py310]

* Use builtin anext [Py310]
2023-01-23 07:56:15 +01:00
GitHub Action 4d215e573c [ci skip] Translation update 2023-01-23 00:23:13 +00:00
Jan Bouwhuis 66c3115b26
Improve MQTT transport select label (#86216) 2023-01-22 22:12:06 +01:00
GitHub Action 771e07c68b [ci skip] Translation update 2023-01-22 00:25:52 +00:00
GitHub Action e1483ff746 [ci skip] Translation update 2023-01-21 00:24:12 +00:00
Franck Nijhof 79b52a2b41
Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
Jan Bouwhuis 92742ae423
Add jammed state support for MQTT lock (#86010)
* Add jammed state support for MQTT lock

* Correct payload jammed key

* Add tests - rename solved to ok

* Rename jammed state and template topics to motor

* Use state topic for handling motor state

* Follow up comments

* Change default behaviour `state_unjammed`

* Skip `state_unjammed`
2023-01-20 12:19:26 +01:00
GitHub Action 59ad232ce5 [ci skip] Translation update 2023-01-20 00:25:31 +00:00
GitHub Action d1ecc418bb [ci skip] Translation update 2023-01-19 00:25:04 +00:00
GitHub Action 87b2a73460 [ci skip] Translation update 2023-01-18 00:24:40 +00: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
Patrick ZAJDA 0b02abf708
Add locking and unlocking to MQTT lock (#85779)
* Implement locking, unlocking and jammed on MQTT lock

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Add tests

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Refactor condition

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Parametrize tests

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Manage only locking and unlocking

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

* Remove jammed from abbreviations

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* set valid states in self._valid_states

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>

Signed-off-by: Patrick ZAJDA <patrick@zajda.fr>
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2023-01-16 08:42:43 +01:00
GitHub Action 77f9548e51 [ci skip] Translation update 2023-01-15 00:25:52 +00:00
Shay Levy 6938f791f9
Downgrade MQTT logging (#85867) 2023-01-14 13:28:41 +01:00
GitHub Action dffc913f9e [ci skip] Translation update 2023-01-14 00:22:57 +00:00
Jan Bouwhuis 64e235285d
Deprecate power_command_topic for MQTT climate (#85229)
* Deprecate mode_command_topic for MQTT climate

* Correct deprecation and remove support release inf

* Do not use future tense for comment

* Extend deprecation period to 6 months
2023-01-12 09:49:14 +01:00