1253 Commits

Author SHA1 Message Date
Jan Bouwhuis
3d00923665
Improve MQTT type hints / refactor part 9 - light (#81151)
* 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
2022-11-17 10:22:25 +01:00
Jan Bouwhuis
f60850586e
Remove b64 encoding work-a-round for MQTT camera (#82244) 2022-11-17 10:11:25 +01:00
epenet
17573196c8
Adjust type hints for CoverEntityFeature (#82238) 2022-11-17 08:39:44 +01:00
GitHub Action
c999953514 [ci skip] Translation update 2022-11-17 00:26:24 +00:00
epenet
e85e79052b
Improve climate type hints for supported_features (#82223) 2022-11-16 23:07:48 +02:00
epenet
f952b74b74
Adjust type hints for AlarmControlPanelEntityFeature (#82186) 2022-11-16 17:08:42 +01:00
epenet
00f4933e72
Import tag from homeassistant.components (#82161) 2022-11-16 07:09:46 +01:00
Jan Bouwhuis
7932864e00
Always update attributes on an update for MQTT update (#82139) 2022-11-15 18:43:01 +01:00
Jan Bouwhuis
285c61c0d7
Add TagProtocol as type hint in MQTT tag (#82134) 2022-11-15 16:54:39 +01:00
Jan Bouwhuis
6975186f2f
Improve MQTT type hints / refactor part 10 - vacuum (#81253)
* 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>
2022-11-15 12:48:02 +01:00
GitHub Action
83a6012f80 [ci skip] Translation update 2022-11-15 00:26:42 +00:00
Aarni Koskela
bbda122c99
Fix mqtt typo (#82086)
mqtt: fix "certiticate" typo
2022-11-14 16:22:23 +01:00
GitHub Action
a6a3bf261d [ci skip] Translation update 2022-11-12 00:28:24 +00: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
GitHub Action
8b4dbbe593 [ci skip] Translation update 2022-11-10 00:27:41 +00:00
GitHub Action
dcf68d768e [ci skip] Translation update 2022-11-09 00:27:20 +00:00
Jan Bouwhuis
b364ef98a0
Use _attr_ for MQTT vacuum (#81534)
* Use `_attr_` for MQTT vacuum

* Remove unneeded properties

* Follow-up comment

* Remove default value
2022-11-08 18:48:08 +01:00
Jan Bouwhuis
7d768dc3a6
Improve MQTT type hints / refactor part 7 - trigger (#81019)
* Improve typing trigger

* Improve hints on templates

* Use new sentinel for template

* Follow-up comment
2022-11-08 17:02:06 +01:00
Aarni Koskela
88a7c76739
Fix late-import paho (#81791)
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.
2022-11-08 16:16:31 +01:00
Jan Bouwhuis
4293c88fb6
Improve MQTT type hints part 6 (#81001)
* 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
2022-11-08 13:11:45 +01:00
Jan Bouwhuis
47dba6f6bc
Improve MQTT type hints part 5 (#80979)
* Improve typing scene

* Improve typing select

* Improve typing sensor

* move expire_after - and class level attrs

* Follow up comment

* Solve type confict

* Remove stale sentinel const

* Update homeassistant/components/mqtt/sensor.py

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

* Make _expire_after a class attribute

* Code styling

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-11-08 12:55:41 +01:00
Jan Bouwhuis
d66d079330
Use _attr_ for MQTT light (#81465)
* Schema basic

* Schema json

* Schema template

* add color_mode - follow up comments

* Fix regression

* Follow up comments 2

* Fix mypy errors

* Update homeassistant/components/mqtt/light/schema_template.py

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

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-11-08 10:16:05 +01:00
Jan Bouwhuis
8c0a7b9d7f
Add type hints for MQTT tag (#81495)
* Improve typing tag

* Additional type hints for tag platform

* Follow up comment tag

* Folow up comments

* Revert comment removal
2022-11-08 09:24:16 +01:00
Jan Bouwhuis
88faf33cb8
Improve type hints for MQTT climate (#81396)
* Improve typing climate

* Move climate type hints to class level

* Apply suggestions from code review

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

* remove stale command after applying suggestions

* cleanup

* Update homeassistant/components/mqtt/climate.py

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

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-11-08 09:17:03 +01:00
GitHub Action
785cf0e29c [ci skip] Translation update 2022-11-08 00:26:39 +00:00
Jan Bouwhuis
b9c47ed3c3
Align MQTT config entry setup strings with option flow (#81616) 2022-11-07 10:45:27 -06:00
epenet
9b2a8901b1
Adjust payload sentinel in mqtt (#81553)
* Adjust payload sentinel in mqtt

* Add type hints

* Update sensor.py

* Adjust vacuum

* Add type hints

* Adjust schema basic

* Remove invalid hint
2022-11-07 12:31:11 +01:00
Jan Bouwhuis
ff4456cb29
Improve MQTT type hints part 4 (#80971)
* 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
2022-11-07 08:24:49 +01:00
GitHub Action
fc472eb040 [ci skip] Translation update 2022-11-06 00:27:15 +00:00
GitHub Action
c7fc51cfa5 [ci skip] Translation update 2022-11-04 00:29:52 +00:00
Jan Bouwhuis
b3403d7fca
Improve MQTT type hints part 3 (#80542)
* 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
2022-11-03 13:06:53 +01:00
Jan Bouwhuis
203c83b6f0
Use _attr_ in MQTT climate (#81406)
* Use _attr_ in MQTT climate

* Follow up comment

* Do not change code
2022-11-03 10:58:37 +01:00
GitHub Action
7995f0e414 [ci skip] Translation update 2022-11-03 00:28:45 +00:00
Jan Bouwhuis
bda7e416c4
Improve MQTT type hints part 2 (#80529)
* Improve typing camera

* Improve typing cover

* b64 encoding can be either bytes or a string.
2022-11-02 20:33:46 +01:00
Jan Bouwhuis
b4ad03784f
Improve MQTT type hints part 1 (#80523)
* Improve typing alarm_control_panel

* Improve typing binary_sensor

* Improve typing button

* Add misssed annotation

* Move CONF_EXPIRE_AFTER to _setup_from_config

* Use CALL_BACK type

* Remove assert, improve code style
2022-11-02 20:33:18 +01:00
epenet
9afabc17ae
Use attr in mqtt sensor (#81402) 2022-11-02 19:50:11 +01:00
epenet
442c5ccc06
Use attr in mqtt fan (#81401)
* Use attr in mqtt fan

* Fix is_on
2022-11-02 16:25:18 +01:00
epenet
a255546e9d
Use attr in mqtt binary sensor and switch (#81403) 2022-11-02 13:41:14 +01:00
epenet
7a930d7e79
Use attr in mqtt humidifier (#81400) 2022-11-02 13:39:36 +01:00
epenet
dd4b843d47
Use attr in mqtt number (#81399) 2022-11-02 13:39:21 +01:00
Jan Bouwhuis
db0785827f
Revert "Do not write state if payload is ''" for MQTT sensor (#81347)
* Revert "Do not write state if payload is ''"

This reverts commit 869c11884e2b06d5f5cb5a8a4f78247a6972149e.

* Add test
2022-11-01 16:25:01 +01:00
Maciej Bieniek
509d5fd69d
Lower log level for non-JSON payload in MQTT update (#81348)
Change log level
2022-11-01 15:57:48 +01:00
GitHub Action
0bca9a614c [ci skip] Translation update 2022-11-01 00:33:48 +00:00
GitHub Action
1c7800c224 [ci skip] Translation update 2022-10-30 00:32:36 +00:00
Jan Bouwhuis
591d13bc49
Move MQTT CONF_SCHEMA from light and vacuum to .const (#81152)
Move CONF_SCHEMA to .const
2022-10-29 10:22:59 +02:00
GitHub Action
4b5de420ed [ci skip] Translation update 2022-10-29 00:24:41 +00:00
Jan Bouwhuis
bcae6d604e
Improve MQTT type hints part 8 (#81034)
* 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
2022-10-28 18:20:33 +02:00
Maciej Bieniek
11ea834cbe
Improve MQTT update platform (#81131)
* Allow JSON as state_topic payload

* Add title

* Add release_url

* Add release_summary

* Add entity_picture

* Fix typo

* Add abbreviations
2022-10-28 17:05:43 +02:00
Jan Bouwhuis
f10f74a65a
Add default source_type for MQTT device_tracker (#81128)
Make sure the source_type is set - default to gps
2022-10-28 10:49:01 +02:00
GitHub Action
f399385147 [ci skip] Translation update 2022-10-28 00:30:47 +00:00