* Convert persistent notification tests to async
* Create/dismiss persistent notifications in exposed functions, not service calls
* Fix notify persistent_notification
* Remove setting up persistent_notification
* Drop more setups
* Empty methods
* Undeprecate sync methods because too big task
* Fix setup clearing notifications
* Fix a bunch of tests
* Fix more tests
* Uno mas
* Test persistent notification events
* Clean up stale comment
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* 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>
* 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
* 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>
* Add zwave_js automation trigger
* Rename to align with zwave-js api
* Improve test coverage
* Add additional template variables
* Support states values in addition to keys when present
* remove entity ID from trigger payload
* comments and order
* Add init and dynamically define platform_type
* reduce mypy ignores
* pylint
* pylint
* review
* use module map
* Add Protection CC select entities
comment
* Disable entity by default
* use class attribute
* Enable protection entity by default
* add guard for none
* 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>
* 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>
* Add zwave_js.meter_reset service
* fix log statement
* Add endpoint attribute to service call and rename service
* Make service an entity service
* remove endpoint from service description
* 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
* 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
* 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>
* 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>
* 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
* 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>
* 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
* 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>
* 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>
* 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>
* 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
* 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>
* 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
* 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>
* 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
* 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
* 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>
* 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>
* Add zwave_js.bulk_set_partial_config_parameters service
* update to handle command status
* add test for awake node
* test using a device in service call
* Bump zwave-js-server-python to 0.23.0 and update integration to support schema changes
* refactor notification evenets a bit
* fix tests and bug fixes
* additional changes due to new PR
* add command class and command name
* use new event names so we can retain event property names
* handle command status being returned from async_set_config_parameter
* bump dependency version
* adjust log message to be consistent
* disable pylint warning
* Update homeassistant/components/zwave_js/services.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* add test for awake node
* switch async_get_registry to async_get
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* 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>
* 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
* add poll_value service
* switch vol.All to vol.Schema
* more relevant log message
* switch service name to refresh_value, add parameter to refresh all watched values, fix tests
* rename parameter and create task for polling command so we don't wait for a response
* raise ValueError for unknown entity
* better error message
* fix test
* 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>
* Add zwave_js.update_log_config service
* fix comment
* reduce lines
* move update_log_config from service to ws API call
* fix docstring
* Add zwave_js/get_log_config WS API command
* resolve stale comments
* remove transports since it will be removed from upstream PR
* add support to update all log config parameters since they could be useful outside of the UI for advanced users
* fix comment
* switch to lambda instead of single line validator
* fix rebase
* re-add ATTR_DOMAIN
* 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
* add thermostat fan mode and fan state support
* return when fan mode is not supported
* use get just in case
* validate state key is in states so we dont have to use get
* pylint
* Fix issue with control of cover when the target value is Up/Down instead of Open/Close
* Adjust open/close/stop cover control to account for no Open/Up or Close/Down targets
* Revert back to using values of 0/99 to close/open a cover since it is supported by all covers
* Replace RELEASE_BUTTON with False and remove unused PRESS_BUTTON in zwave_js cover
* Remove v4 multilevel transitional currentValue workaround
This was only needed because the get-after-set was reporting a
transitional currentValue instead of the final one.
zwave-js v6.1.1 removes the get-after-set functionality completely, so
this is no longer required (and breaks status reporting entirely)
* Fix tests to check currentValue instead of targetValue as well
* 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
* 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>
* add zwave_js support for climate
* fix
* add fixture
* rename fixture
* fix variable name error
* add tests
* fix tests and handle set_temp properly based on unit
* update call being tested
* fix tests
* improve coverage
* fix docstring
* address review comments
* fix test
* update enum class name
* bump zwave-js-server-python version and assume primary_value is always set
* add additional coverage
* fix docstrings and move populating modes/presets into initialization
* attempt to address comments
* improve comment
* move mode value into a variable so its easier to iterate in the future
* dont assume mode as a discovery point
* assume all values are available when node is ready
* fix order of operations
* switch to valueerror
* use primary value
* readd property and type to discovery schema
* Add bulb 6 multi color device state fixture
* Add light test foundation
* Add no cover comment for todo code
* Update hs_color
* Test turn on light
* Test light turn off
* Fix brightness comparison
* Test setting same brightness
* Test setting same rgb color
* Test color temp update
* Test setting same color temp
* Add entity module to coverage calculation
* Fix typing
* Add entry setup and unload test
* Test home assistant stop
* Test on connect and on disconnect
* Test client connect timeout
* Test ready node added
* Test non ready node added
* Test existing node not ready
* Test device registry state
* Add common test tools module
* Add existing ready node test
* Include init module in coverage calculation
* Clean docstrings
* Run zwave_js scaffold (#44891)
* Add zwave_js basic connection to zwave server (#44904)
* add the basic connection to zwave server
* fix name
* Fix requirements
* Fix things
* Version bump dep to 0.1.2
* fix pylint
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Bump zwave-js-server-python to 0.2.0
* Use zwave js server version check instead of fetching full state (#44943)
* Use version check instead of fetching full state
* Fix tests
* Use 0.3.0
* Also catch aiohttp client errors
* Update docstring
* Lint
* Unignore zwave_js
* Add zwave_js entity discovery basics and sensor platform (#44927)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Complete zwave_js typing (#44960)
* Type discovery
* Type init
* Type entity
* Type config flow
* Type sensor
* Require typing of zwave_js
* Complete zwave_js config flow test coverage (#44955)
* Correct zwave_js sensor device class (#44968)
* Fix zwave_js KeyError on entry setup timeout (#44966)
* Bump zwave-js-server-python to 0.5.0 (#44975)
* Remove stale callback signal from zwave_js (#44994)
* Add light platform to zwave_js integration (#44974)
* add light platform
* styling fix
* fix type hint
* Fix typing
* Update homeassistant/components/zwave_js/const.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/entity.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/entity.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/entity.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/entity.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/entity.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* color temp should be integer
* guard Nonetype error
* 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>
* some fixes after merging
* add additional guards for None values
* adjustments for rgb lights
* Fix typing
* Fix black
* Bump zwave-js-server-python to 0.6.0
* guard value updated log
* remove value_id lookup as its no longer needed
* fiz sending white value
* Update homeassistant/components/zwave_js/light.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add zwave_js test foundation (#44983)
* Exclude text files from codespell
* Add basic dump fixture
* Add test foundation
* Fix test after rebase
* Exclude jsonl files from codespell
* Rename fixture file type to jsonl
* Update fixture path
* Fix stale docstring
* Add controller state json fixture
* Add multisensor 6 state json fixture
* Update fixtures
* Remove basic dump fixture
* Fix fixtures after library bump
* Update codeowner
* Minor cleanup Z-Wave JS (#45021)
* Update zwave_js device_info (#45023)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>