Commit Graph

322 Commits (7e70252de58d6dfa857eb35c1d21a599b0fc655f)

Author SHA1 Message Date
GitHub Action ecf0d4398d [ci skip] Translation update 2021-07-22 00:10:31 +00:00
Raman Gupta 90765132cc
Make additional input for zwave_js device triggers optional (#53134) 2021-07-20 22:08:08 -07:00
Marc Mueller a56485a8c5
Revert new unit types (#53226) 2021-07-20 14:13:51 +02:00
Raman Gupta 05fa220703
Add support for options in zwave_js.set_value service (#53212) 2021-07-20 10:31:12 +02:00
GitHub Action ac9e4cb2f2 [ci skip] Translation update 2021-07-20 00:11:11 +00:00
Ville Skyttä 470f2dd73f
Upgrade pyupgrade to 2.21.2, apply its changes (#52987) 2021-07-19 10:46:09 +02:00
GitHub Action 531733da7b [ci skip] Translation update 2021-07-19 00:09:50 +00:00
Marc Mueller 71a8ae3016
Add new unit types for better type checking (#53124)
* Add new unit types
* Update helper functions
* Update components
* Update lcn climate
2021-07-18 14:43:47 +02:00
GitHub Action 8f3166a955 [ci skip] Translation update 2021-07-18 00:10:14 +00:00
kpine 24cc5c8a0a
Replace local Barrier CC constants with library enums (#53109) 2021-07-17 02:54:11 -04:00
GitHub Action e6e1118dd4 [ci skip] Translation update 2021-07-17 00:09:24 +00: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
GitHub Action 62a2efaf27 [ci skip] Translation update 2021-07-16 00:10:34 +00:00
GitHub Action db8db18b54 [ci skip] Translation update 2021-07-15 00:09:25 +00: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
Raman Gupta f13a15f2a6
Make zwave_js value updated event logic more performant (#52997) 2021-07-14 08:56:10 +02:00
GitHub Action 7b7062dded [ci skip] Translation update 2021-07-14 00:10:16 +00:00
Raman Gupta 9cbf88d944
Switch to using entry.async_on_remove (#52952) 2021-07-13 10:31:49 +02:00
Raman Gupta 4a058503ca
Change behavior of Z-Wave JS services (#52941)
* Change behavior of Z-Wave JS services

* pop parameters in for loop

* Update logger message
2021-07-13 01:02:36 -04:00
Raman Gupta e915f5be53
Handle FailedCommand exceptions in zwave_js WS API (#52461)
* Handle zwave-js errors in WS API

* Unsubscribe callbacks when zwave-js error is caught

* fix tests

* simplify unsub logic

* add tests

* add kwargs to be safe

* use existing msg format

* switch to generic failed command handling

* remove unneeded constant

* Update homeassistant/components/zwave_js/api.py

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

* Update homeassistant/components/zwave_js/api.py

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

* fix

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-07-13 00:13:43 -04:00
GitHub Action 6723942bf8 [ci skip] Translation update 2021-07-13 00:13:03 +00:00
Raman Gupta e652ef51a1
Initial support for zwave_js device conditions (#52003) 2021-07-11 21:22:33 -07:00
GitHub Action 2ddaf746e6 [ci skip] Translation update 2021-07-12 00:09:46 +00:00
Raman Gupta f234da6379
Bump zwave-js-server-python to 0.27.1 (#52885) 2021-07-11 16:27:46 -04:00
GitHub Action b347226820 [ci skip] Translation update 2021-07-10 00:09:24 +00:00
Chris 92ab471f7b
Add transition support to zwave_js lights (#52160)
* Add transition support to zwave_js lights

* Add transition support to color_switch lights

* simplify and add tests

* fix logic

* add check for color transition to add SUPPORT_TRANSITON supported features

* Use new metadata property

* Use new metadata property

* update tests and device state dump json files

* fix file perms

* update tests and fixtures with new metadata

* update test

* update test

* update tests for color transitions

* check for color tansitions as well

* more tests

* fix color transtions

* remove unneed default

* set add_to_watched_value_ids to false

* set transition default

* properly set default

* update tests

* make sure transition is an int

* suggested changes

* Update homeassistant/components/zwave_js/light.py

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

* Update homeassistant/components/zwave_js/light.py

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

* Update homeassistant/components/zwave_js/light.py

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

* Update homeassistant/components/zwave_js/light.py

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

* Update homeassistant/components/zwave_js/light.py

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

* formatting

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-07-09 12:15:20 -04:00
GitHub Action f7e4db512f [ci skip] Translation update 2021-07-09 00:09:30 +00:00
GitHub Action b5a6d05778 [ci skip] Translation update 2021-07-08 00:13:44 +00:00
Raman Gupta 81fe3583c9
Don't raise when setting HVAC mode without a mode ZwaveValue (#52444)
* Don't raise an error when setting HVAC mode without a value

* change logic based on discord convo and add tests

* tweak
2021-07-06 16:33:07 +02:00
GitHub Action abc9b01ede [ci skip] Translation update 2021-07-05 00:09:10 +00:00
Raman Gupta 8f186957ea
Mark entities for dead zwave_js nodes as unavailable (#48017)
* Don't create any devices or entities for dead zwave_js nodes

* mark entities for dead nodes as unavailable

* add test

* watch for node status updates

* update tests to handle node status changes as well
2021-07-03 22:06:07 -04:00
GitHub Action 86f46753c9 [ci skip] Translation update 2021-07-01 00:12:17 +00:00
Franck Nijhof d3210ada1d
Allow None value return type for Number entity state value (#52302) 2021-06-29 15:07:31 +02:00
Raman Gupta d6fd7dde7f
Bump zwave_js_server to 0.27.0 (#52267) 2021-06-28 18:49:40 -04:00
GitHub Action 5c5e43afc1 [ci skip] Translation update 2021-06-28 00:10:15 +00:00
GitHub Action 473ab98a67 [ci skip] Translation update 2021-06-27 00:09:39 +00:00
GitHub Action cd9fa27f2a [ci skip] Translation update 2021-06-26 00:10:53 +00:00
GitHub Action febc276db9 [ci skip] Translation update 2021-06-25 00:12:31 +00:00
Martin Hjelmare 0e5040d917
Add zwave_js options flow to reconfigure server (#51840) 2021-06-24 13:15:42 +02: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 1e18011603
Adjust zwave_js WS API commands for logging (#51096) 2021-06-17 17:19:25 +02:00
Raman Gupta a250343c55
Support bitmask as a value (#51892)
* Support bitmask as a value

* Fix value schema and add tests

* fix test

* revert change to value schema
2021-06-16 15:53:45 -04:00
Raman Gupta 3db8d9ede5
Require admin for new node status WS API command (#51863) 2021-06-15 09:34:04 +02:00
Raman Gupta 8705168fe6
Add zwave_js WS API cmds to get node state and version info (#51396)
* Add zwave_js view to retrieve a node's state

* remove typehints

* Make dump views require admin

* Add version info to node level dump

* Add back typehints

* switch from list to dict

* switch from dump node view to two WS API commands

* switch to snake
2021-06-14 16:43:51 -04:00
Raman Gupta f00f2b4ae4
Add zwave_js ping node service (#51435)
* Add zwave_js ping node service

* uncomment code

* use asyncio.gather
2021-06-14 16:38:35 -04:00
Raman Gupta 0d40ba463e
Create zwave_js node status sensor when the node is added (#51850)
* Create node status sensor when the node is added

* Handle race condition

* reduce repeat code
2021-06-14 19:31:44 +02:00
Martin Hjelmare c3cfbfe54b
Refactor zwave_js config flow (#51720) 2021-06-12 13:12:17 +02:00
Martin Hjelmare be137b085b
Refactor zwave_js disconnect client helper (#51718) 2021-06-12 11:35:33 +02:00
GitHub Action c81df50191 [ci skip] Translation update 2021-06-06 00:19:43 +00:00
Raman Gupta b3327e1656
Bump zwave-js-server-python to 0.26.1 (#51425) 2021-06-03 15:11:45 -04:00
Raman Gupta ba6a0b5793
Fix no value error for heatit climate entities (#51392) 2021-06-02 21:07:47 -07:00
Martin Hjelmare 91b6f9d7d0
Bump zwave-js-server-python to 0.26.0 (#51341) 2021-06-01 19:26:54 +02:00
Raman Gupta b91696c139
Switch to using entity class attributes where possible in zwave_js (#51207)
* Switch to using entity class attributes where possible in zwave_js

* fix

* revert docstring

* remove unused init

* Revert some changes based on feedback in #51181

* switch to class atributes
2021-06-01 10:26:22 +02: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
Franck Nijhof 255e13930c
Define CoverEntity entity attributes as class variables (#51236)
* Define CoverEntity entity attributes as class variables

* Fix supported features
2021-05-29 14:35:02 +02:00
Raman Gupta ca8d09e5e1
Add zwave_js.multicast_set_value service (#51115)
* Add zwave_js.multicast_set_value service

* comment

* Add test for multiple config entries validation

* additional validation test

* brevity

* wrap schema in vol.Schema

* Update homeassistant/components/zwave_js/services.py

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

* do node transform and multicast validation in schema validation

* move poll value entity validation into schema validation, pass helper functions dev and ent reg instead of retrieving it every time

* make validators nested functions since they don't neeed to be externally accessible

* Update homeassistant/components/zwave_js/services.py

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

* Remove errant ALLOW_EXTRA

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-27 21:57:35 -04:00
Raman Gupta 877d3e38b4
Fix zwave_js.set_value schema (#51114)
* fix zwave_js.set_value schema

* wrap all schemas in vol.Schema

* readd removed assertions
2021-05-27 00:27:35 -04:00
Raman Gupta 18e6ae8750
Add WS API commands to check for and install zwave_js config updates (#51106) 2021-05-26 08:39:08 -07:00
Raman Gupta 6d9b67ddb2
Add zwave_js heal node and network WS API commands (#51047)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-26 08:38:02 -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 4875035ff8
Add zwave_js WS API commands for node ping and metadata (#51049) 2021-05-25 17:37:12 +02:00
tkdrob 028a07d86f
Wrap up selectors (#50794)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-05-25 14:45:17 +02: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
Martin Hjelmare bdb8cdf717
Fix zwave_js None color value (#50926) 2021-05-25 13:40:22 +02:00
Raman Gupta 3573249720
Bump zwave-js-server-python to 0.25.0 (#51053) 2021-05-25 13:10:42 +02:00
Raman Gupta ebf6e3d985
Add zwave_js WS API commands to replace and remove failed nodes (#51018)
* Add zwave_js WS API commands to replace and remove failed nodes

* no need to manually add node to driver in test
2021-05-24 13:11:09 -04:00
Erik Montnemery b169a8dbda
Mark battery, humidity and pressure sensors as STATE_CLASS_MEASUREMENT (#50924)
* Mark battery, humidity and pressure sensors as STATE_CLASS_MEASUREMENT

* Fix deconz battery sensor
2021-05-24 11:36:42 +02:00
Martin Hjelmare b4bb7c38ce
Fix zwave_js api typing (#50923) 2021-05-21 14:20:58 +02:00
Martin Hjelmare 07e2f53b37
Add zwave_js add-on info dataclass (#50776) 2021-05-21 13:47:37 +02:00
Erik Montnemery 73d7a754e8
Mark temperature sensors as STATE_CLASS_MEASUREMENT (#50889)
* Mark temperature sensors as STATE_CLASS_MEASUREMENT

* Fix broadlink tests

* Tweak Hue changes
2021-05-21 11:44:34 +02: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
Michael 9eecd90afc
Add constructor return type in integrations T-Z (#50899) 2021-05-20 17:00:19 +02:00
Dror Eiger 0556c35e24
Set zwave_js cover device_class for shutters and blinds (#50643)
* 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
Charles Garwood f33b45ec82
Add interview feedback for Z-Wave JS add node websocket (#50384)
* Add interview feedback for add node websocket

* cleanup leftover logging

* add tests

* test interview failed event

* fix event type

* include manufacturer & model from device registry

* update test
2021-05-14 09:47:09 -04:00
HomeAssistant Azure 7df47664e8 [ci skip] Translation update 2021-05-12 00:04:03 +00:00
Raman Gupta 1b81849271
Add zwave_js support for HeatIt Z-TRM2fx (#50317)
* 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
HomeAssistant Azure f32e15da36 [ci skip] Translation update 2021-05-08 00:03:19 +00:00
Martin Hjelmare 5ec09eab42
Move not loaded websocket constant to zwave_js (#50188) 2021-05-06 17:59:03 -07:00
Martin Hjelmare 38d7652176
Fix zwave_js websocket api KeyError on unloaded entry (#50154) 2021-05-06 16:43:14 +02:00
Franck Nijhof 2ed386f9e6
Migrate to async_get_current_platform everywhere (#50034) 2021-05-03 09:34:28 -07:00
Franck Nijhof 378cee01b4
Add typing to async_register_entity_service (#50015) 2021-05-03 14:22:38 +02:00
HomeAssistant Azure 04266301e9 [ci skip] Translation update 2021-05-03 00:05:16 +00:00
Franck Nijhof 64c7d84108
Clean up connection classes in integrations T-Z (#49894) 2021-04-30 21:04:05 -10:00
Ville Skyttä 59f32f7c9c
Make device info a TypedDict (#49670) 2021-04-30 23:21:39 +02:00
Raman Gupta fdc29d6a80
Add device specific discovery for Heatit Z-TRM3 thermostat (#49804)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-30 16:10:25 +02:00
Erik Montnemery 956c972e72
Add color_mode support to zwave_js light (#49588) 2021-04-30 13:46:25 +02:00
Ville Skyttä a19f757120
Allow str 1..n-tuples in device registry identifier type hints (#49864)
This reflects current practice, but the intent has been to have them as
2-tuples, and a future change is likely to start enforcing that (again).

Refs https://github.com/home-assistant/core/pull/49670#discussion_r622344872
2021-04-30 08:56:55 +02:00
Ruslan Sayfutdinov 183220008d
Rename FlowResultDict to FlowResult (#49847) 2021-04-29 13:40:51 +02:00
Ruslan Sayfutdinov 0301706fc6
Define AddEntitiesCallback type (#49812) 2021-04-29 12:28:14 +02:00
Chris e85d58c3a1
Fix white_value causing zwave-js to set non-existing values (#49799) 2021-04-28 09:23:48 -07:00
Raman Gupta 795fe18a90
Add additional zwave_js WS API commands for nodes (#49509)
* Add zwave_js WS API commands for node.refresh_values and node.refresh_cc_values

* remove guard since API will be used by frontend

* add missing validation

* use get in case node ID is wrong

* use decorator

* add additional coverage
2021-04-28 10:22:18 -04:00
Martin Hjelmare 9e1042d9e0
Fix zwave_js flow set add-on options (#49813)
* Fix zwave_js flow set add-on options

* Improve and deduplicate error messages

* Add more call assertions

* Add final missing call assertion
2021-04-28 15:09:39 +02:00
Raman Gupta 1cb907c2e3
Add zwave_js discovery schema for Vision Security ZL7432 (#49510)
* 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
J. Nick Koston 3fa8ffa731
Enable mccabe complexity checks in flake8 (#49616)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02:00
Raman Gupta 99c5087c1e
Add WS API command to capture zwave_js logs from server (#49444)
* Add WS API commands to capture zwave_js logs from server

* register commands

* create a task

* Update homeassistant/components/zwave_js/api.py

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

* Update homeassistant/components/zwave_js/api.py

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

* fix

* fixes and add test

* fix PR on rebase

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-21 07:37:35 -04:00
Charles Garwood cad281b326
Add subscription for Z-Wave JS node re-interview status (#49024)
* Add subscription for interview status

* update test

* forward stage completed event

* add additional test

* additional tests

* return earlier
2021-04-21 07:35:16 -04:00
Raman Gupta 6e22251e1d
Add support to enable/disable zwave_js data collection (#49440) 2021-04-20 21:40:54 -04:00
Raman Gupta cf16e651cf
Bump zwave_js dependency to 0.24.0 (#49445)
* Bump zwave_js dependency to 0.24.0

* fix bug in schema

* fix test
2021-04-20 23:44:26 +02:00