Commit Graph

93 Commits (d6a7127b845e420280971082cbdb655d64ed1c76)

Author SHA1 Message Date
Raman Gupta 5d3d66e47d
Bump zwave-js-server-python to 0.50.1 (#94760)
* Bump zwave-js-server-python to 0.50.0

* handle additional upstream changes

* Additional changes

* fix tests

* Convert two similar functions to be one function

* Fix docstring

* Remove conditional pydantic import

* Revert scope change

* Bump zwave-js-server-python

* Set default return value for command

* Remove line breaks

* Add coverage
2023-08-10 01:28:08 -04:00
Adrián Moreno 0e428f8d39
Deprecate Dry and Fan preset modes in favor of HVAC modes (#95634)
* zwave_js: deprecate Dry and Fan preset modes

Migrating Dry and Fan presets to HVAC modes

* Move consts. Set Dry and Fan as HVAC-first modes.

* Update homeassistant/components/zwave_js/climate.py

Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>

* Fix tests

* Keep track of HA release when deprecation was introduced

---------

Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
2023-07-05 15:12:21 -04:00
Raman Gupta 3934f91242
Make Z-Wave device IBT4ZWAVE discoverable as a cover (#93946)
* Make Z-Wave device IBT4ZWAVE discoverable as a cover

* Test device class
2023-06-02 06:09:53 -04:00
Jeff Grieger 47a2d5b472
Add zwave_js speed config for additional GE/Jasco fan controllers (#92371)
* Add zwave_js speed config for additional GE/Jasco fan controllers

Add speed info for Honeywell(GE/Jasco) 39358 In-Wall Fan Speed Control and Enbrighten(GE/Jasco) 55258 In-Wall Fan Speed Control.

* Add test for Honeywell 39358 In-Wall Fan Speed Control
2023-06-01 00:09:35 +02:00
Raman Gupta 1eb1ea08b0
Add support for Energy Production CC sensors (#93839) 2023-05-31 13:28:07 +02:00
Raman Gupta 05c3d8bb37
Add zwave_js node statistics sensors (#91714)
* Add node statistics sensors

* fix tests and don't let controller state leak across tests

* Add background RSSI

* Remove extra logging statement

* fix test

* comments

* setup platform once

* Add static properties to entity description

* Update homeassistant/components/zwave_js/sensor.py

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

* don't dupe attribute values in entity description

* fix exception

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-05-30 20:44:32 +02:00
Raman Gupta 90bf5429ca
Add support for Window Covering CC (#93314)
* Refactor zwave_js.cover and improve test coverage

* Remove extra fixtures

* cleanup old stuff

* Get coverage to 100

* Add support for Window Covering CC

* fix bug

* typo

* remove redundant stuff

* slight change to improve readability

* Add device class

* Update to match specs
2023-05-30 11:26:23 -04:00
Raman Gupta 3e84c374f4
Improve zwave.cover tests (#93458)
* Improve zwave.cover tests

* Update conftest.py
2023-05-24 18:51:15 +02:00
Raman Gupta 872cd47e87
Add proper support for zwave_js Indicator CC (#90248)
* Add proper support for zwave_js Indicator CC

* remove stale test

* Make all indicators diagnostic

* only set entity category if it is specified

* Only set properties from discovery if specified

* Conditionally set assumed state as well

* fix const name

* Don't create task

* Disable property keys 3-5 by default

* add additional dispatcher_connects so we catch all signals

* be consistent about order

* rename new discovery parameter

* comment

* exclude property keys 3-5

* fix remove logic

* add comment so I don't forget

* Switch entity category to config where necessary

* cut line

* less lines

* Update homeassistant/components/zwave_js/switch.py

Co-authored-by: kpine <keith.pine@gmail.com>

* Move async_remove to respond to interview started event

* Set up listener immediately so we don't wait for platform creation

* remove dupe import

* black

* append

---------

Co-authored-by: kpine <keith.pine@gmail.com>
2023-05-24 09:09:38 -04:00
Raman Gupta cbe85126cb
Introduce a delay between update entity calls (#89737)
* Introduce a delay between update entity calls

* Update homeassistant/components/zwave_js/update.py

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

* move delay to constant and patch

* rename constant

* Switch to async_call_later

* Remove failing test

* Reimplement to solve task problem

* comment

* pass count directly so that value doesn't mutate before we store it

* lines

* Fix logic and tests

* Comments

* Readd missed coverage

* Add test for delays

* cleanup

* Fix async_added_to_hass logic

* flip conditional

* Store firmware info in extra data so we can restore it along with latest version

* Comment

* comment

* Add test for is_running check and fix bugs

* comment

* Add tests for various restore state scenarios

* move comment so it's less confusing

* improve typing

* consolidate into constant and remove unused one

* Update update.py

* update test to unknown state during partial restore

* fix elif check

* Fix type

* clean up test docstrings and function names

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-03-20 18:30:56 -04:00
Marius Stedjan 9fc6700c5a
Add ZWaveDiscoverySchema for Merten 507801 (#88342)
* Add ZWaveDiscoverySchema for Merten 507801

* Add discovery tests to Merten 507801 z-wave device

* Add Z-Wave discovery schemas for Merten 507801 to disable endpoint 2 by default

* Add more discovery tests for Merten 507801 z-wave device
2023-03-01 00:47:47 -05:00
Franck Nijhof 57cf11f067
Enable Ruff PT015 (#86775) 2023-01-27 11:10:29 +01:00
Franck Nijhof e50a531cd9
Code styling tweaks to the tests - Part 2 (#86662)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2023-01-26 01:23:53 +01:00
Martin Hjelmare 94b80db968
Handle not available add-on in hassio add-on manager (#84943)
* Handle not available add-on in hassio add-on manager

* Fix zwave_js tests

* Fix sky connect tests

* Fix matter tests

* Fix yellow tests

* Update hardware tests
2023-01-02 20:28:21 -05:00
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
Erik Montnemery aaec464627
Add support for managing the silabs multiprotocol add-on (#82170)
* Add support for managing the silabs multiprotocol add-on

* Fix passing context when starting option flow

* Allow unloading a ha yellow config entry

* Fix tests

* Log data passed to ZHA option flow

* Improve ZHA migration logic

* Move tests

* Improve test coverage

* Remove dead code

* Drop automatic ZHA migration
2022-11-16 17:38:07 +01:00
Martin Hjelmare 9ded232522
Move zwave_js addon manager to hassio integration (#81354) 2022-11-10 10:09:52 +01:00
Raman Gupta 06178d3446
Only redact zwave_js values that are worth redacting (#78420)
* Only redact zwave_js values that are worth redacting

* Tweak test

* Use redacted fixture for test
2022-09-16 15:04:55 -06:00
Michael Kowalchuk 19cf5dfc6d
Add zwave_js speed configuration for Leviton ZW4SF fans (#60677)
* Add speed info for Leviton 4 speed fans

* Use new format for fan speed configuration

* Add a fixture and test for the Leviton ZW4SF

* Use pytest.approx
2022-09-09 22:06:01 +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
Raman Gupta 9d14201b13
Don't create two zwave_js.lock entities for a single device (#68651) 2022-03-28 11:15:48 +02:00
Raman Gupta 8293430e25
Redact user codes from zwave_js diagnostics (#68515)
* Redact user codes from zwave_js diagnostics

* simplify test

* Remove unused logic

* revert change and make all inputs to ZwaveValueID optional

* revert change and make all inputs to ZwaveValueID optional

* Remove unused diagnostics data from fixture and test location redaction

* Add empty ZwaveValueID check

* Improve coverage

* Simplify post_init check

* Use dataclasses.astuple for checks instead
2022-03-23 21:13:27 +01: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 9fe61f9e7f
Add zwave_js light support for HSM-200 V1 (#67089)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-23 20:18:42 +01:00
Francois Chagnon 87593fa3ec
Add Humidifier support to zwave_js (#65847) 2022-02-23 18:01:45 +01: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
Raman Gupta 639181108f
Add zwave_js support for Fortrezz SSA3 (#62765) 2021-12-25 10:33:20 +01:00
Michael Kowalchuk 15bf4dae9b
Add zwave_js speed configurations for GE/Jasco 12730 and 14287 fans (#60517) 2021-11-29 08:27:32 +01:00
Michael Kowalchuk 74cfbf5f42
Use configured speed ranges for HomeSeer FC200+ fan controllers in zwave_js (#59697)
* Use configured speed ranges for HomeSeer FC200+ fan controllers in zwave_js

* Fix pylint errors

* Remove unused param in tests

* Fix test values

* Address various review notes

* Remove now-redundant assertion

* Add an additional test case for set_percentage=0

* Use round() instead of int() for percentage computations; this makes the percentage setting match the setpoints in the UI

* Add additional tests

* Fix pct conversions

* Make conversion tests exhaustive

* Add tests for discovery data templates

* Revert "Add tests for discovery data templates"

This reverts commit 85dcbc0903.

* Improve typing on ConfigurableFanSpeedDataTemplate#resolve_data

* Move config error handling to the discovery data template

* Fix checks for config data

* Revise fallback logic in percentage_to_zwave_speed and ensure that the speed list is non-empty

* Rework error handling

* Fix runtime fan speed updates

* Use warning instead of warn

* Move data validation to get_speed_config; turns out that resolve_data is only called once, at startup.

* Temporarily remove the not-yet-used fixed fan speed template.  Add an additional assertion to ensure speeds are sorted.

* Add a comment about the assertions in discovery_data_template.py

* Update homeassistant/components/zwave_js/discovery_data_template.py

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

* Fix typo in comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-24 11:31:59 +01:00
Paul Frank 3705f2f7f1
Open and close tilt for Fibaro devices in zwave_js (#58435)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-28 22:30:34 +02:00
Raman Gupta 8716aa011a
Add support for multilevel switch CC select entities (#56656)
* Add support for multilevel switch CC select entities

* Use state names from docs and include more device identifiers from device DB

* black

* pylint

* type fix

* Add failure scenario test

* Update homeassistant/components/zwave_js/select.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-26 14:22:41 -04:00
Raman Gupta 714564eaa6
Listen to node events in the zwave_js node status sensor (#55341) 2021-08-27 15:01:20 -07:00
Erik Montnemery 5536e24dec
Remove `last_reset` attribute and set state class to `total_increasing` for zwave_js energy sensors (#54818) 2021-08-18 15:11:10 +02:00
Raman Gupta 013b998974
Relax zwave_js lock discovery rules to cover more use cases (#54710) 2021-08-17 13:34:00 +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
Raman Gupta 30cbf03b48
Add energy support for zwave_js meter CC entities (#53665)
* Add energy support for zwave_js meter CC entities

* shrink

* comments

* comments

* comments

* Move attributes

* Add tests

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-07-29 14:18:38 +02:00
Joakim Sørensen 9806bda272
Rename snapshot -> backup (#51629) 2021-07-27 22:43:05 +02:00
p4p3r 9d79c4f617
Add On/Off as target values for zwave_js cover stop action (#52881)
* Add On/Off as target values for stop cover

Certain ZWave Cover devices use On/Off instead of the more common
Open/Close and Up/Down targets for movement.
Adding On/Off to the targets used to stop the cover during movement.
Fixes issue #51963

* Add test for updated zwave_js stop cover logic
2021-07-16 15:48:35 +02:00
Raman Gupta dd908caeba
Add zwave_js device triggers (#51968)
* Initial support for zwave_js device triggers

* lint

* Add node status changed trigger

* comments

* create helper function and simplify trigger logic

* simplify code

* fix exception

* remove unused type ignore

* switch to append to make future changes easier

* make exception consistent

* Add state config schema validation

* comment

* remove 0 from falsy check

* increase test coverage

* typos

* Add central scene and scene activation value notification triggers

* reorder things for readability and enumerate node statuses

* Add support for Basic CC value notifications

* fix schemas since additional fields on triggers aren't very flexible

* pylint

* remove extra logger statement

* fix comment

* dont use get when we know key will be available in dict

* tweak text

* use better schema for required extra fields that are ints

* rename trigger types to make them easier to parse

* fix strings

* missed renaming of one trigger type

* typo

* Fix strings

* reduce complexity

* Use Al's suggestion for strings

* add additional failure test cases

* remove errant logging statement

* make CC required

* raise vol.Invalid when value ID isn't legit to prepare for next PR

* Use helper function

* fix tests

* black
2021-07-14 14:14:36 -04:00
Raman Gupta 1f15181522
Add support for Z-Wave JS siren (#52948)
* Add support for Z-Wave JS siren

* Add additional device class to discovery

* fix docstring

* Remove device class specific part of discovery schema

* rename test

* switch to entry.async_on_remove

* Fix logic based on #52971

* Use constants to unblock PR

* Add support to set volume level

* Update homeassistant/components/zwave_js/siren.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-07-14 10:14:13 -04:00
Martin Hjelmare 0e5040d917
Add zwave_js options flow to reconfigure server (#51840) 2021-06-24 13:15:42 +02:00
Raman Gupta ba6a0b5793
Fix no value error for heatit climate entities (#51392) 2021-06-02 21:07:47 -07:00
Raman Gupta 1de0d20a76
Bump zwave-js-server-python to 0.25.1 (#51097)
* Bump zwave-js-server-python to 0.25.1

* update fixtures
2021-05-26 12:37:24 +02:00
Raman Gupta 5f7964b54b
Add firmware updates support for zwave_js (#50390)
* Add WS API support for zwave_js firmware updates

* move file to fixture

* review comments

* fix logic and test based on upstream changes

* handle failure scenario

* handle failure scenario

* fix tests and adjust message

* Update homeassistant/components/zwave_js/api.py

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

* remove return from firmware upload view because client will raise an exception if not successful

* raise if user is not an admin

* raise bad request exception if firmware command fails

* incorporate #50923

* Add test for failed command

* add event name to messages

* change error to not found

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-05-26 02:57:00 -04:00
Raman Gupta c0234df136
Remove device_registry fixture from zwave_js tests (#51072) 2021-05-25 08:48:21 -07:00