Commit Graph

2431 Commits (8a7e0241ab0c91e2ed6b8672188988969b64ef14)

Author SHA1 Message Date
functionpointer c01e01f797
MySensors config flow (#45421)
* MySensors: Add type annotations

Adds a bunch of type annotations that were created
while understanding the code.

* MySensors: Change GatewayId to string

In preparation for config flow.
The GatewayId used to be id(gateway).

With config flows, every gateway will have its own
ConfigEntry. Every ConfigEntry has a unique id.
Thus we would have two separate but one-to-one related ID systems.

This commit removes this unneeded duplication by using the id of the ConfigEntry
as GatewayId.

* MySensors: Add unique_id to all entities

This allows entities to work well with the frontend.

* MySensors: Add device_info to all entities

Entities belonging to the same node_id will now by grouped as a device.

* MySensors: clean up device.py a bit

* MySensors: Add config flow support

With this change the MySensors can be fully configured from the GUI.

Legacy configuration.yaml configs will be migrated by reading them once.
Note that custom node names are not migrated. Users will have to re-enter
the names in the front-end.
Since there is no straight-forward way to configure global settings,
all previously global settings are now per-gateway. These settings include:
- MQTT retain
- optimistic
- persistence enable
- MySensors version

When a MySensors integration is loaded, it works as follows:
1. __init__.async_setup_entry is called
2. for every platform, async_forward_entry_setup is called
3. the platform's async_setup_entry is called
4. __init__.setup_mysensors_platform is called
5. the entity's constructor (e.g. MySensorsCover) is called
6. the created entity is stored in a dict in the hass object

* MySensors: Fix linter errors

* MySensors: Remove unused import

* MySensors: Feedback from @MartinHjelmare

* MySensors: Multi-step config flow

* MySensors: More feedback

* MySensors: Move all storage in hass object under DOMAIN

The integration now stores everything under hass.data["mysensors"]
instead of using several top level keys.

* MySensors: await shutdown of gateway instead of creating a task

* MySensors: Rename Ethernet to TCP

* MySensors: Absolute imports and cosmetic changes

* MySensors: fix gw_stop

* MySensors: Allow user to specify persistence file

* MySensors: Nicer log message

* MySensors: Add lots of unit tests

* MySensors: Fix legacy import of persistence file name

Turns out tests help to find bugs :D

* MySensors: Improve test coverage

* MySensors: Use json persistence files by default

* MySensors: Code style improvements

* MySensors: Stop adding attributes to existing objects

This commit removes the extra attributes that were being
added to the gateway objects from pymysensors.

Most attributes were easy to remove, except for the gateway id.
The MySensorsDevice class needs the gateway id as it is part of its DevId
as well as the unique_id and device_info.
Most MySensorsDevices actually end up being Entities.
Entities have access to their ConfigEntry via self.platform.config_entry.

However, the device_tracker platform does not become an Entity.
For this reason, the gateway id is not fetched from self.plaform but
given as an argument.

Additionally, MySensorsDevices expose the address of the gateway
(CONF_DEVICE). Entities can easily fetch this information via self.platform,
but the device_tracker cannot. This commit chooses to remove the gateway
address from device_tracker. While this could in theory break some automations,
the simplicity of this solution was deemed worth it.
The alternative of adding the entire ConfigEntry as an argument to MySensorsDevices
is not viable, because device_tracker is initialized by the async_setup_scanner function
that isn't supplied a ConfigEntry. It only gets discovery_info.
Adding the entire ConfigEntry doesn't seem appropriate for this edge case.

* MySensors: Fix gw_stop and the translations

* MySensors: Fix incorrect function calls

* MySensors: Fewer comments in const.py

* MySensors: Remove union from _get_gateway and remove id from try_connect

* MySensors: Deprecate nodes option in configuration.yaml

* MySensors: Use version parser from packaging

* MySensors: Remove prefix from unique_id and change some private property names

* MySensors: Change _get_gateway function signature

* MySensors: add packaging==20.8 for the version parser

* MySensors: Rename some stuff

* MySensors: use pytest.mark.parametrize

* MySensors: Clean up test cases

* MySensors: Remove unneeded parameter from devices

* Revert "MySensors: add packaging==20.8 for the version parser"

This reverts commit 6b200ee01a.

* MySensors: Use core interface for testing configuration.yaml import

* MySensors: Fix test_init

* MySensors: Rename a few variables

* MySensors: cosmetic changes

* MySensors: Update strings.json

* MySensors: Still more feedback from @MartinHjelmare

* MySensors: Remove unused strings

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* MySensors: Fix typo and remove another unused string

* MySensors: More strings.json

* MySensors: Fix gateway ready handler

* MySensors: Add duplicate detection to config flows

* MySensors: Deal with non-existing topics and ports.

Includes unit tests for these cases.

* MySensors: Use awesomeversion instead of packaging

* Add string already_configured

* MySensors: Abort config flow when config is found to be invalid while importing

* MySensors: Copy all error messages to also be abort messages

All error strings may now also be used as an abort reason,
so the strings should be defined

* Use string references

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-05 22:13:57 +01:00
Fabian Affolter 097a4e6b59
Upgrade praw to 7.1.2 (#46012) 2021-02-04 23:42:10 +01:00
Fabian Affolter c7febacd9f
Upgrade holidays to 0.10.5.2 (#46013) 2021-02-04 23:32:56 +01:00
Martin Hjelmare 912b816117
Bump zwave-js-server-python to 0.17.2 (#46010) 2021-02-04 20:44:40 +01:00
Martin Hjelmare b80c1688ad
Bump zwave-js-server-python to 0.17.1 (#45988) 2021-02-04 16:29:41 +01:00
Niccolo Zapponi a775b79d4b
Add support for iCloud 2FA (#45818)
* Add support for iCloud 2FA

* Updated dependency for iCloud

* Updated dependency and logic fix

* Added logic for handling incorrect 2FA code

* Bug fix on failing test

* Added myself to codeowners

* Added check for 2FA on setup

* Updated error message
2021-02-03 19:18:31 +01:00
Brandon Rothweiler 4b208746e5
Add Mazda Connected Services integration (#45768) 2021-02-03 17:38:12 +01:00
Shay Levy 0875f654c8
Add support for Shelly battery operated devices (#45406)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-03 17:03:22 +01:00
Paulus Schoutsen 40ba182144
Upgrade Z-Wave JS Python to 0.17.0 (#45895) 2021-02-03 11:58:46 +01:00
jjlawren 048f36c77e
Bump plexapi to 3.4.1 (#45878) 2021-02-03 08:44:34 +01:00
Quentame d9dba1b7ab
Bump Freebox to 0.0.9 (#45837)
* Bump Freebox to 0.0.9

* Remove @SNoof85 from code owners

* Module is now freebox_api
2021-02-02 22:57:06 +01:00
Bram Kragten bf9b3bf9db
Update frontend to 20210127.7 (#45874) 2021-02-02 22:45:51 +01:00
Martin Hjelmare 524b9e7b1f
Use new zwave_js client (#45872)
* Use new zwave_js client

* Remove client callbacks

* Clean up on connect and on disconnect

* Clean log

* Add stop listen to unsubscribe callbacks

* Fix most tests

* Adapt to new listen interface

* Fix most tests

* Remove stale connection state feature

* Bump zwave-js-server-python to 0.16.0

* Clean up disconnect
2021-02-02 20:59:56 +01:00
Fabian Affolter 811bbb7acb
Upgrade emoji to 1.2.0 (#45847) 2021-02-02 15:56:56 +01:00
Fabian Affolter 63cc2517dd
Upgrade watchdog to 1.0.2 (#45848) 2021-02-02 15:53:03 +01:00
Fabian Affolter 60d4dadcb6
Upgrade sqlalchemy to 1.3.23 (#45845) 2021-02-01 16:03:51 -10:00
Fabian Affolter d38d8a542d
Upgrade colorlog to 4.7.2 (#45840) 2021-02-01 19:01:19 -05:00
Alessandro Pilotti 8222eb5e3e
Allow Influxdb CA path in verify_ssl (#45270) 2021-02-01 23:29:31 +01:00
Maciej Bieniek 776b1395de
Bump brother library to version 0.2.0 (#45832) 2021-02-01 20:43:43 +01:00
Johan Nenzén 285bd3aa91
Add support for Keg and Airlock to Plaato using polling API (#34760)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-01 07:12:56 -10:00
Martin Hjelmare 31a84555b9
Bump zwave-js-server-python to 0.15.0 (#45813) 2021-02-01 10:54:07 +01:00
Pierre Ståhl 03928dbe55
Bump pyatv to 0.7.6 (#45799) 2021-02-01 08:34:55 +01:00
Marcel van der Veldt 3e080f88c6
Bump zwave-js-server-python to 0.14.2 (#45800) 2021-01-31 17:14:20 -05:00
J. Nick Koston 852af7e372
Update homekit for new async library changes (#45731) 2021-01-31 21:40:24 +01:00
Aidan Timson 2d10c83150
Honeywell Lyric Integration (#39695)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-01-31 07:51:31 -10:00
Erik Montnemery ca43b3a8bb
Bump pychromecast to 8.0.0 (#45776) 2021-01-31 16:35:29 +01:00
Bram Kragten 6b44636344
Update frontend to 20210127.6 (#45760) 2021-01-31 00:51:33 +01:00
Anders Melchiorsen 1fd3a86239
Upgrade pysonos to 0.0.40 (#45743) 2021-01-30 15:38:43 +01:00
Aaron Bach 14c2053841
Bump simplisafe-python to 9.6.4 (#45716)
* Bump simplisafe-python to 9.6.4

* Fix imports
2021-01-29 13:30:21 -07:00
Bram Kragten df00f32dfc
Updated frontend to 20210127.5 (#45714) 2021-01-29 20:12:03 +01:00
bsmappee 3f67f9e09c
Bump pysmappee to 0.2.16 (#45699) 2021-01-29 15:01:55 +01:00
Pascal Reeb ba55f1ff4b
Add config flow for nuki (#45664)
* implemented config_flow for nuki component

* warn -> warning

* exception handling & config_flow tests

* gen_requirements_all

* Update config_flow.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2021-01-29 11:05:13 +01:00
Tom Harris aacf6bd100
Fix formatting IntEnum as hex in 3.8.x (#45686) 2021-01-29 09:07:18 +01:00
Aaron Bach 4f3b10d661
Stop Tile setup on invalid auth (#45683) 2021-01-29 08:57:36 +01:00
Bram Kragten eb370e9494
Update frontend to 20210127.3 (#45679) 2021-01-29 00:46:28 +01:00
Maciej Bieniek 92efe4f491
Bump gios library (#45639) 2021-01-28 13:28:39 +01:00
Erik Montnemery 5711d61b38
Bump hatasmota to 0.2.7 (#45625) 2021-01-28 08:55:22 +01:00
Bram Kragten 73a04e653f
Update frontend to 20210127.1 (#45612) 2021-01-27 19:32:44 +01:00
starkillerOG ef3bdd1afc
Bump motionblinds to 0.4.8 (#45609) 2021-01-27 18:01:00 +01:00
springstan 566058f701
Add config flow to fritzbox_callmonitor (#40736) 2021-01-27 16:53:45 +01:00
Tobias Sauerwein f14c4412b7
Migrate RMV to use httpx (#42560) 2021-01-27 15:57:58 +01:00
Dennis Schroer 8d572af77a
Add Huisbaasje integration (#42716)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-01-27 15:53:25 +01:00
Robert Chmielowiec 80c2efa9f2
Add total energy, preheater and RMOT sensors to comfoconnect (#45373) 2021-01-27 08:10:58 -05:00
Aaron Bach 3841f0e42d
Re-architect Tile integration with new pytile (#43071) 2021-01-27 12:06:09 +01:00
Martin Hjelmare 122a4e03f8
Bump zwave-js-server-python to 0.14.1 (#45598) 2021-01-27 11:17:47 +01:00
Jim Ekman 67b309394f
Esphome fan direction (#44495) 2021-01-27 10:40:33 +01:00
J. Nick Koston 25f411ef6e
Add support for Pico and Shade remotes to Lutron Caseta (#45315) 2021-01-26 16:32:08 -06:00
J. Nick Koston 56253a6245
Bump httplib2 in google and remember_the_milk (#45578)
Fixes CVE-2020-11078
2021-01-26 18:51:20 +01:00
Franck Nijhof 52c56fdac7
Upgrade pillow to 8.1.0 (#45574) 2021-01-26 18:12:02 +01:00
Alexei Chetroi 9ae4818a23
Update ZHA dependencies (#45569) 2021-01-26 11:54:05 -05:00