Commit graph

62 commits

Author SHA1 Message Date
Franck Nijhof
fcb612cd6f
Collection of code styling tweaks () 2023-02-03 23:51:27 +01:00
Franck Nijhof
ca1a12898c
Enable Ruff D212 () 2023-02-03 23:08:48 +01:00
Michael Kowalchuk
19cf5dfc6d
Add zwave_js speed configuration for Leviton ZW4SF fans ()
* 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
d25a76d3d6
Use Platform and ValueType enum in zwave_js.discovery () 2022-08-28 00:47:46 +02:00
Raman Gupta
9d14201b13
Don't create two zwave_js.lock entities for a single device () 2022-03-28 11:15:48 +02:00
Raman Gupta
8293430e25
Redact user codes from zwave_js diagnostics ()
* 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
Michael Kowalchuk
e0b577f8bd
Add zwave_js fan preset modes and enable them for Inovelli LZW36 ()
* Rework fan data templates to support preset modes, and define data for the Inovelli LZW36

* Add tests. Add dispatching to async_set_preset_mode in async_turn_on.

* Add a test case for invalid preset modes

* Remove unintended merge artifact

* Fix indentation

* Fix merge error

* rm blank line

* Add tests for invalid fan config data, and fix an issue where this prevented the node from being added.

* Fix tests and improve error handling
2022-03-19 03:56:05 +01:00
Francois Chagnon
21aa07e3e5
Add Z-Wave thermostat fan entity ()
* 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
9fe61f9e7f
Add zwave_js light support for HSM-200 V1 ()
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 () 2022-02-23 18:01:45 +01:00
Raman Gupta
639181108f
Add zwave_js support for Fortrezz SSA3 () 2021-12-25 10:33:20 +01:00
Michael Kowalchuk
15bf4dae9b
Add zwave_js speed configurations for GE/Jasco 12730 and 14287 fans () 2021-11-29 08:27:32 +01:00
Michael Kowalchuk
74cfbf5f42
Use configured speed ranges for HomeSeer FC200+ fan controllers in zwave_js ()
* 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 ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-28 22:30:34 +02:00
Raman Gupta
e9d25974b8
Switch to using constants wherever possible in zwave_js () 2021-09-30 02:21:53 +02:00
Raman Gupta
8716aa011a
Add support for multilevel switch CC select entities ()
* 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
c785983cce
Handle entity creation on new added zwave_js value ()
* 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
Raman Gupta
331726ec2f
Bump zwave-js-server-python to 0.29.1 () 2021-08-30 09:40:56 -07:00
Raman Gupta
ebc2a0103e
Make zwave_js discovery log message more descriptive () 2021-08-29 20:25:47 -07:00
Raman Gupta
1f2134a31a
Use entity descriptions for zwave_js sensors ()
* Use entity descriptions for zwave_js sensors

* reorder

* use new type

* revert typing changes

* switch to using maps

* Get device and state class from discovery instead

* ues constants for keys

* Add meter type attribute and simplify platform data access

* comments

* second refactor

* Add None lookup value

* readability

* Switch base data template to type Any for more flexibility

* Additional changes based on feedback

* rewrite based on new upstream util functions

* Use new combo type

* Handle UnknownValueData in discovery

* bug fixes

* remove redundant comment

* re-add force_update

* fixes and tweaks

* pylint and feedback
2021-08-20 16:25:39 -04:00
Raman Gupta
cff6883b5c
Add zwave_js Protection CC select entities ()
* Add Protection CC select entities

comment

* Disable entity by default

* use class attribute

* Enable protection entity by default

* add guard for none
2021-08-17 12:22:27 -04:00
Raman Gupta
013b998974
Relax zwave_js lock discovery rules to cover more use cases () 2021-08-17 13:34:00 +02:00
Raman Gupta
a41ee9e870
Create zwave-js select platform and discover additional siren values ()
* Create zwave-js select platform and add siren values to number and select platforms

* use constants while we wait for lib release

* comments

* rename stuff in tests to prepare for protection CC PR

* Switch to 0-1 range for number entity

* Update homeassistant/components/zwave_js/number.py

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

* Change step

* Switch to ToneID

* Better error handling

* Add test for coerage

Co-authored-by: kpine <keith.pine@gmail.com>
2021-08-16 13:36:20 -04:00
Raman Gupta
61ab2b0c60
Use zwave_js.number platform for Basic CC values ()
* Use zwave_js.number platform for some Basic CC values

* Remove Basic CC sensor discovery schema

* update comment

* update comment
2021-08-16 12:30:52 -04:00
Raman Gupta
30cbf03b48
Add energy support for zwave_js meter CC entities ()
* 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
Raman Gupta
1019ee22ff
Add enabled attribute to zwave_js discovery model ()
* Add attribute to zwave_js discovery model

* Fix binary sensor entity enabled logic

* Add tests
2021-07-29 09:30:50 +02:00
Raman Gupta
1f15181522
Add support for Z-Wave JS siren ()
* 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 

* 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
Dror Eiger
0556c35e24
Set zwave_js cover device_class for shutters and blinds ()
* Set device_class for shutters and blinds

* Add missing. imports

* Add tests for device class setting

* Clean up

* Avoid storing the node in an unused variable

* Fix entity name

* Extend qubino shutter discovery

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-16 08:26:16 +02:00
Raman Gupta
1b81849271
Add zwave_js support for HeatIt Z-TRM2fx ()
* Add zwave_js support for HeatIt Z-TRM2fx

* fix docstring

* use AwesomeVersion to support firmware version ranges

* add guard against empty firmware range

* switch guard approach to raise exception sooner

* make post init more generic

* Set up firmware range schema as AwesomeVersion during initialization

* Update homeassistant/components/zwave_js/discovery.py

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

* Allow min_ver and max_ver to be None

* fix docstring

* reduce import scope

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-09 15:28:35 -04:00
Raman Gupta
fdc29d6a80
Add device specific discovery for Heatit Z-TRM3 thermostat ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-30 16:10:25 +02:00
Raman Gupta
1cb907c2e3
Add zwave_js discovery schema for Vision Security ZL7432 ()
* Add zwave_js discovery schema for Vision Security ZL7432

* add tests

* fix test

* add correct fixture

* Make discussed changes

* fix tests

* move event handler

* fix logic to get entity ID

* add test

* make discovery test more explicit

* remove domain from event data

* always provide entity_id key to make automations easier and translate value if possible

* formatting

* comment

* dont overwrite value
2021-04-28 10:22:54 +02:00
Marc Mueller
c07646db5d
Update typing syntax ()
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
Raman Gupta
fbc3f97097
Add support for selective config parameter entity discovery ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-27 18:14:06 +01:00
Franck Nijhof
f4cc4a0896
Merge of nested IF-IF cases - X-Z () 2021-03-26 17:08:05 +01:00
Marc Mueller
dcca29ef68
Update typing 14 () 2021-03-18 15:08:35 +01:00
Chris
6d478804e7
Add LZW36 device schema to zwave_js discovery ()
* Add LZW26 device schema to discovery

Co-authored-by: @kpine

* Update homeassistant/components/zwave_js/discovery.py

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

* Add tests

* Fix test

Co-authored-by: kpine <keith.pine@gmail.com>
2021-03-04 00:32:37 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups ()
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Marcel van der Veldt
7ca148f65d
Fix Z-Wave JS discovery schema for thermostat devices ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-26 11:19:23 -08:00
Raman Gupta
a43f3c1a0c
Fix zwave_js unique ID migration logic () 2021-02-24 23:14:32 -08:00
Marcel van der Veldt
23cbd2dda3
Change Z-Wave JS discovery logic to adopt changes to DeviceClass ()
Co-authored-by: raman325 <7243222+raman325@users.noreply.github.com>
2021-02-24 12:59:06 -08:00
Marcel van der Veldt
868a536d81
Add number platform to Z-Wave JS ()
* add number platform to zwave_js integration
* add discovery scheme for thermostat valve control, using number platform

Co-authored-by: kpine <keith.pine@gmail.com>
2021-02-24 19:39:35 +01:00
Marcel van der Veldt
d4d68ebc64
Extend zwave_js discovery scheme for lights () 2021-02-23 16:31:24 -08:00
kpine
2ae790283c
Detect iBlinds v2.0 switch value as a cover not light ()
* Remove unused "fibaro_fgs222" discovery hint

* Simplify multilevel switch current value discovery schema

* Force iBlinds v2.0 devices to be discovered as cover entities

* Rename discovery test file
2021-02-20 19:52:23 +01:00
Jesse Campbell
12477c5e46
Fix missing color switch specific device class for Z-Wave JS driver >6.3 () 2021-02-18 07:58:43 -05:00
Gaetan Semet
4ab0151fb1
Discover HRT4-ZW / SRT321 SetPoint in zwave_js ()
Missing a specific class to allow discovery of the setpoint command.

Fix 

Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
2021-02-17 15:06:16 +01:00
kpine
dfa973f9ef
Add barrier covers to zwave_js integration () 2021-02-14 13:24:29 +01:00
Marcel van der Veldt
b7dd9bf58f
Enhance platform discovery for zwave_js () 2021-02-12 13:29:11 +01:00
Marcel van der Veldt
829131fe51
Update zwave_js discovery scheme for boolean sensors in the Alarm CC () 2021-02-08 11:57:22 -05:00
Marcel van der Veldt
be779d8712
update discovery scheme for zwave_js light platform () 2021-02-08 11:56:19 -05:00
Tobias Sauerwein
5615ab4c25
Add support for climate setpoint thermostats to zwave_js () 2021-02-03 13:59:19 +01:00