Commit Graph

51 Commits (345081ba158f0c3db55d7b0cd3d9a2dc3d03e0e5)

Author SHA1 Message Date
Raman Gupta 41d5256533
Add via_device support to zwave_js (#83219)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-12-06 22:56:33 -05:00
Raman Gupta 3884b4b6bf
Bump zwave-js-server-python to 0.42.0 (#79020) 2022-09-28 21:24:04 -04:00
Raman Gupta 4fbf44cced
Create repair issue if zwave-js-server is too old (#78670)
* Create repair issue if zwave-js-server is too old

* Switch is_fixable to false

* review comments
2022-09-18 21:25:37 +02:00
Raman Gupta abebf3c067
Switch to new entity naming schema across zwave_js (#77434) 2022-09-12 09:14:59 +02:00
Martin Hjelmare f11b51e12b
Fix zwave_js device re-interview (#78046)
* Handle stale node and entity info on re-interview

* Add test

* Unsubscribe on config entry unload
2022-09-08 20:15:27 +02:00
Raman Gupta 91fbff05db
Improve performance impact of zwave_js update entity and other tweaks (#77866)
* Improve performance impact of zwave_js update entity and other tweaks

* Reduce concurrent polls

* we need to write state after setting in progress to false

* Fix existing tests

* Fix tests by fixing fixtures

* remove redundant conditional

* Add test for delayed startup

* tweaks

* outdent happy path

* Add missing PROGRESS feature support

* Update homeassistant/components/zwave_js/update.py

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

* Update homeassistant/components/zwave_js/update.py

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

* Fix tests by reverting outdent, PR comments, mark callback

* Remove redundant conditional

* make more readable

* Remove unused SCAN_INTERVAL

* Catch FailedZWaveCommand

* Add comment and remove poll unsub on update

* Fix catching error and add test

* readability

* Fix tests

* Add assertions

* rely on built in progress indicator

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-09-06 09:40:20 -04:00
Raman Gupta df214c2d26
Add support for zwave_js firmware update service (#77401)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-08-30 12:49:27 -04:00
Martin Hjelmare 842cc060f8
Fix zwave_js addon info (#76044)
* Add add-on store info command

* Use add-on store info command in zwave_js

* Fix init tests

* Update tests

* Fix method for addon store info

* Fix response parsing

* Fix store addon installed response parsing

* Remove addon info log that can contain network keys

* Add supervisor store addon info test

* Default to version None if add-on not installed

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-08-03 22:33:05 +02:00
Martin Hjelmare f7475a5bdb
Clean zwave_js entity driver access (#72427) 2022-05-24 17:52:07 -04:00
Raman Gupta 79dc551f5a
Fix regression in zwave_js (#69312)
* Handle unique ID update during discovery step

* Use callback to convert unique IDs to strings

* Adjust test to make sure logic works

* Fix other tests

* Move comment

* Move migration to async_setup

* Remove async_migrate_entry since we take care of it during setup

* Remove unused test
2022-04-06 00:40:33 -04:00
Raman Gupta e06856f965
Make zwave_js config entry unique ID a string (#69163)
* Make zwave_js config entry unique ID a string

* Add test

* Fix tests
2022-04-02 23:52:07 -04:00
Francois Chagnon 21aa07e3e5
Add Z-Wave thermostat fan entity (#65865)
* Add Z-Wave thermostat fan entity

* Fix failing test, increase number of entities to 27

* Add tests to improve coverage

* Take back unrelated changes to climate.py

* Clean up guard clauses, use info.primary_value, and make entity disabled by default

* Fix tests

* Add more tests for code coverage

* Remove unused const

* Remove speed parameter from overridden method since it was removed from entity

* Address PR comments
2022-03-15 22:17:51 -04:00
Raman Gupta ad4409bcb0
Don't add extra entities for zwave_js controller (#67209)
* Don't add extra entities for zwave_js controller

* Revert reformat of controller_state

* fix indentation issues

* fix indentation issues
2022-02-25 07:39:30 +01:00
Raman Gupta 4ff1f5c788
Create zwave_js ping button at the right time (#66848)
* Create zwave_js ping button at the right time

* fix tests
2022-02-19 11:16:14 +01:00
Raman Gupta 82ebb7047f
Bump zwave-js-server-python to 0.35.0 (#66785)
* Bump zwave-js-server-python to 0.35.0

* Remove support for new event type which should go in a separate PR
2022-02-18 02:36:27 -05:00
Raman Gupta 152dbfd2fe
Add button entity to ping zwave_js node (#66129)
* Add button entity to ping zwave_js node

* Fix docstring

* Fix docstrings

* Fix and simplify tests

* Fix name

* Update homeassistant/components/zwave_js/button.py

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

* Update homeassistant/components/zwave_js/services.py

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

* Update homeassistant/components/zwave_js/button.py

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

* Update homeassistant/components/zwave_js/button.py

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

* Update homeassistant/components/zwave_js/button.py

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

* review comments

* Update homeassistant/components/zwave_js/button.py

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

* Update homeassistant/components/zwave_js/button.py

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

* Remove self.client line

* Add callback to remove entity

* Add extra dispatch signal on replacement

* Combine signals for valueless entities

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-14 15:38:22 -05:00
kpine 22e475790f
Avoid removing zwave_js devices for non-ready nodes (#59964)
* Only replace a node if the mfgr id / prod id / prod type differ

* Prefer original device name for unready node

* move register_node_in_dev_reg into async_setup_entry

* simplify get_device_id_ext

* Don't need hex ids

* Revert "move register_node_in_dev_reg into async_setup_entry"

This reverts commit f900e5fb0c67cc81657a1452b51c313bccb6f9e1.

* Revert Callable change

* Revert device backup name

* Add test fixtures

* Update existing not ready test with new fixture data

* Check device properties after node added event

* Add entity check

* Check for extended device id

* better device info checks

* Use receive_event to properly setup components

* Cleanup tests

* improve test_replace_different_node

* improve test_replace_same_node

* add test test_node_model_change

* Clean up long comments and strings

* Format

* Reload integration to detect node device config changes

* update assertions

* Disable entities on "value removed" event

* Disable node status sensor on node replacement

* Add test for disabling entities on remove value event

* Add test for disabling node status sensor on node replacement

* disable entity -> remove entity

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-12-27 12:31:31 +01:00
Ville Skyttä 7db3246de4
Make config entry disabled_by an enum (#60445)
* Make config entry disabled_by an enum

* Update homeassistant/config_entries.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-12-15 20:53:21 +01:00
Martin Hjelmare fa716d92ad
Manage s2 keys in zwave_js (#56783) 2021-09-29 15:04:24 -07:00
Raman Gupta b1f4ccfd6b
Reuse zwave_js device when replacing removed node with same node (#56599)
* Reuse zwave_js device when a removed node is replaced with the same node

* Ensure change is backwards compatible with servers that don't include replaced

* Remove lambda

* Add assertions to remove type ignores

* fix tests by always copying state and setting manufacturer/label attributes
2021-09-25 10:43:37 +02:00
Raman Gupta c785983cce
Handle entity creation on new added zwave_js value (#55987)
* Handle new entity creation when a new value is added

* spacing

* Update homeassistant/components/zwave_js/__init__.py

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

* change variable name and use asyncio.gather

* Centralized where discovered value IDs gets managed

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-10 23:49:31 +02:00
Joakim Sørensen da3419945c
Rename snapshot -> backup (#53851) 2021-08-02 11:07:21 +02:00
Joakim Sørensen a9722c90e9
Revert "Rename snapshot -> backup" (#53751)
This reverts commit 9806bda272.
2021-07-30 12:44:10 -07:00
Joakim Sørensen 9806bda272
Rename snapshot -> backup (#51629) 2021-07-27 22:43:05 +02:00
Raman Gupta 0eae0cca2b
Move zwave_js migration tests into new module (#52075) 2021-06-21 20:42:03 -04:00
Raman Gupta 8a9a141f3c
Fix zwave_js migration logic (#52070)
* Fix zwave_js migration logic

* revert change to move tests to new module

* Update tests/components/zwave_js/test_init.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-06-21 16:45:47 -04:00
Raman Gupta a8650f4e59
Add zwave_js node status sensor (#51181)
* Add zwave_js node status sensor

* fix import

* use parent class name property

* Use more entity class attributes

* Update homeassistant/components/zwave_js/sensor.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* return static values in property method

* fix PR

* switch to class atributes

* create sensor platform task if needed

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-05-31 08:46:28 +02:00
Raman Gupta c0234df136
Remove device_registry fixture from zwave_js tests (#51072) 2021-05-25 08:48:21 -07:00
Martin Hjelmare 9319fc6263
Update zwave_js stored add-on options (#51063)
* Update zwave_js entry data if add-on data changed

* Fix tests

* Add test
2021-05-25 08:37:34 -04:00
Ville Skyttä 19d25cd901
Change config entry state to an enum (#49654)
* Change config entry state to an enum

* Allow but deprecate EntryState str equality comparison

* Test fixes

* Rename to ConfigEntryState

* Remove str comparability backcompat

* Update new occurrences of strs cropped up during review
2021-05-20 19:19:20 +02:00
Franck Nijhof c68b259bd3
Cleanup of unused connection_class logic (#49865)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-29 23:12:58 +02:00
Raman Gupta 6e22251e1d
Add support to enable/disable zwave_js data collection (#49440) 2021-04-20 21:40:54 -04:00
Raman Gupta fe6d6895aa
Migrate existing zwave_js entities if endpoint has changed (#48963)
* Migrate existing zwave_js entities if endpoint has changed

* better function name

* cleanup code

* return as early as we can

* use defaultdict instead of setdefault

* PR comments

* re-add missing logic

* set defaultdict outside of for loop

* additional cleanup

* parametrize tests

* fix reinterview logic

* test that we skip migration when multiple entities are found

* Update tests/components/zwave_js/test_init.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-13 16:37:55 +02:00
Erik Montnemery b3fecb1c95
Update tests t-z to use async_get() instead of async_get_registry() (#47655) 2021-03-09 14:25:03 +01:00
Raman Gupta 1d387e12cc
Add fallback zwave_js entity name using node ID (#47582)
* add fallback zwave_js entity name using node ID

* add new fixture and test for name that was failing
2021-03-08 09:08:17 +01:00
Martin Hjelmare 0350a6ed21
Only create snapshot if add-on update will be done (#47424) 2021-03-04 16:38:33 -08:00
Raman Gupta ee69e93b46
Bump zwave-js-server-python to 0.21.0 (#47408)
Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
2021-03-04 16:15:50 -08:00
Martin Hjelmare d3721bcf26
Add zwave_js add-on manager (#47251)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-03-02 14:22:42 -08:00
Raman Gupta 3e34bb3e89
Add suggested area for zwave_js devices (#47250) 2021-03-01 15:24:55 -08:00
Raman Gupta 7118b7169c
catch ValueError when unique ID update fails because its taken and remove the duplicate entity (#47072) 2021-02-25 20:41:54 -05:00
Raman Gupta a43f3c1a0c
Fix zwave_js unique ID migration logic (#47031) 2021-02-24 23:14:32 -08:00
Raman Gupta 424526db7e
Migrate zwave_js entities to use new unique ID format (#46979)
* migrate zwave_js entities to use new unique ID format

* remove extra param from helper

* add comment to remove migration logic in the future

* update comment

* use instance attribute instead of calling functino on every state update
2021-02-24 09:41:10 -05:00
Raman Gupta 5a3bd30e01
Add zwave_js.set_config_parameter service (#46673)
* create zwave_js.set_config_value service

* update docstring

* PR comments

* make proposed changes

* handle providing a label for the new value

* fix docstring

* use new library function

* config param endpoint is always 0

* corresponding changes from upstream PR

* bug fixes and add tests

* create zwave_js.set_config_value service

* update docstring

* PR comments

* make proposed changes

* handle providing a label for the new value

* fix docstring

* use new library function

* config param endpoint is always 0

* corresponding changes from upstream PR

* bug fixes and add tests

* use lambda to avoid extra function

* add services description file

* bring back the missing selector

* move helper functions to helper file for reuse

* allow target selector for automation editor

* formatting

* fix service schema

* update docstrings

* raise error in service if call to set value is unsuccessful

* Update homeassistant/components/zwave_js/services.yaml

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update homeassistant/components/zwave_js/services.yaml

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update homeassistant/components/zwave_js/services.yaml

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update homeassistant/components/zwave_js/services.yaml

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update homeassistant/components/zwave_js/services.yaml

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update homeassistant/components/zwave_js/services.yaml

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* remove extra param to vol.Optional

* switch to set over list for nodes

* switch to set over list for nodes

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-02-23 11:35:11 -05:00
Martin Hjelmare c94968d811
Catch more zwave_js errors (#46957) 2021-02-23 16:36:53 +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
Martin Hjelmare 6e205965ee
Fix zwave_js device remove test (#45864) 2021-02-02 15:28:21 +01:00
Raman Gupta a64ad50b27
Remove zwave_js devices that the controller is no longer connected to on initialization (#45853)
* Remove zwave_js devices that the controller is no longer connected to on initialization

* remove extra line break

* fix test

* Clean up

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Lint

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-02 10:30:12 +01:00
Martin Hjelmare f387e833c3
Add zwave_js add-on config flow support (#45552) 2021-01-27 08:56:16 +01:00
Paulus Schoutsen bf8d17f1b5
Better wait for Z-Wave to be initialized (#45520) 2021-01-25 13:12:58 +01:00
Marcel van der Veldt a276f2d19e
Fix zwave_js adding not fully interviewed nodes (#45162)
* fix situation were nodes are being added or not fully interviewed

* adjust test

* lint
2021-01-15 01:09:03 +01:00