Commit graph

51 commits

Author SHA1 Message Date
Marc Mueller
9b9b553521
Disable no-self-use [pylint] (#70641)
* Disable no-self-use

* Remove disable comments
2022-04-25 07:41:01 -07:00
Raman Gupta
a12d6aa6ff
Log error when using zwave_js 'refresh_value' on ping button/node status sensor (#66847)
* Raise when using 'zwave_js.refresh_value' on ping button

* Revert test change

* block till done

* Switch from raising an exception to logging an error for both the ping button and node status sensor

* missed commit
2022-02-22 12:03:01 +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
Raman Gupta
9e4e43cf77
Handle zwave_js metadata/value updates when the unit changes (#63579)
* Handle zwave_js metadata updates when the unit changes

* Use value updated event instead of metadata updated event so we don't get an invalid state value

* update comments and formatting

* simplify

* Update tests/components/zwave_js/test_sensor.py

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

* Update tests/components/zwave_js/test_sensor.py

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

* Update tests/components/zwave_js/test_sensor.py

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

* fix tests

* add additional assertions

* Add unit checks and simplify logic

* Add unit assertion

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-08 13:23:29 +01: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
Robert Hillis
b559d8845e
Use enums in zwave_js (#62130)
* Use enums in zwave_js

* oops
2021-12-19 12:28:09 +01:00
Michael
90e52cd3ad
Use relative imports [S-Z] (#61576) 2021-12-13 09:39:13 +01:00
Raman Gupta
edd068d6eb
Add explicit unit mapping for zwave_js meters and sensors (#59659)
* Add explicit unit mapping for zwave_js meters and sensors

* review comment

* fix

* alternate approach
2021-11-17 12:26:32 -05:00
Raman Gupta
0f64e7036f
Bump zwave-js-server-python to 0.32.0 (#59727) 2021-11-17 11:56:48 +01:00
Marc Mueller
e0c0d00833
Use assignment expressions 39 (#58829) 2021-10-31 18:56:25 +01:00
epenet
c8cbd0070d
Use DeviceInfo in zwave-js (#58649) 2021-10-28 19:00:12 -05:00
Raman Gupta
b71773fd1d
Set entity_category for node status sensor (#58434) 2021-10-25 17:54:13 -04:00
Martin Hjelmare
5642350070
Add zwave_js sensor entity categories (#58416) 2021-10-25 18:14:44 +02:00
Marius
4ce7166afd
Add node sensor status icons (#56137)
Co-authored-by: kpine <keith.pine@gmail.com>
Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
2021-09-27 12:50:14 +02:00
Marc Mueller
48bada5a18
Update pylint to 2.11.1 (#56364) 2021-09-18 13:52:59 +02:00
Raman Gupta
1fd3faf766
Fix state class for zwave_js energy entities (#56026) 2021-09-09 16:19:28 -04:00
Martin Hjelmare
b088ce601c
Bump zwave-js-server-python to 0.30.0 (#55831) 2021-09-06 13:37:12 -07:00
Raman Gupta
331726ec2f
Bump zwave-js-server-python to 0.29.1 (#55460) 2021-08-30 09:40:56 -07:00
Raman Gupta
d62a78ae61
Don't set zwave_js sensor device class to energy when unit is wrong (#55434) 2021-08-30 08:48:36 -07:00
Raman Gupta
714564eaa6
Listen to node events in the zwave_js node status sensor (#55341) 2021-08-27 15:01:20 -07:00
Raman Gupta
1f2134a31a
Use entity descriptions for zwave_js sensors (#53744)
* 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
08193169d0
Remove unnecessary signal during zwave_js.reset_meter service call (#54837) 2021-08-18 19:27:41 +02: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
61ab2b0c60
Use zwave_js.number platform for Basic CC values (#54512)
* 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
Erik Montnemery
ae507aeed1
Move temperature conversions to sensor base class (8/8) (#54483)
* Move temperature conversions to entity base class (8/8)

* Fix wallbox sensor

* Fix tests
2021-08-11 21:17:16 +02:00
Martin Hjelmare
c959a0a484
Limit zwave_js meter sensor last reset (#53921) 2021-08-03 22:50:14 +02:00
Martin Hjelmare
6d30e596ca
Fix zwave_js current and voltage meter sensor device class (#53723) 2021-07-29 14:26:57 -07:00
Martin Hjelmare
3c0e4b1fd9
Fix zwave_js meter sensor state class (#53716) 2021-07-29 12:25:43 -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
Raman Gupta
1019ee22ff
Add enabled attribute to zwave_js discovery model (#53645)
* 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
e1c6ccb198
Add zwave_js.reset_meter service (#53390)
* 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
2021-07-28 23:15:27 +02:00
Raman Gupta
9cbf88d944
Switch to using entry.async_on_remove (#52952) 2021-07-13 10:31:49 +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
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
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
Ruslan Sayfutdinov
0301706fc6
Define AddEntitiesCallback type (#49812) 2021-04-29 12:28:14 +02:00
Raman Gupta
fbc3f97097
Add support for selective config parameter entity discovery (#48336)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-27 18:14:06 +01:00
Raman Gupta
058d232c57
Determine zwave_js sensor device class during initialization (#48304) 2021-03-24 20:08:16 -04:00
Erik Montnemery
0c086b5067
Migrate integrations w-z to extend SensorEntity (#48217) 2021-03-22 19:50:29 +01:00
Franck Nijhof
fb849b81b5
Rewrite of not a == b occurances (#48132) 2021-03-20 01:27:04 +01:00
Marc Mueller
dcca29ef68
Update typing 14 (#48078) 2021-03-18 15:08:35 +01:00
Martin Hjelmare
40c12997ed
Add zwave_js sensor humidity device class (#47953) 2021-03-15 20:51:24 +01:00
Erik Montnemery
1fc8e32d86
Update integrations t-z to override extra_state_attributes() (#47760) 2021-03-11 20:16:26 +01:00
Raman Gupta
af4e6f856f
Use better names for zwave_js platforms that are self describing (#46083)
* use better names for platforms that are self describing

* add missing light change

* fix tests

* only use value_name in sensors and binary_sensors
2021-02-06 12:08:25 +01:00
Raman Gupta
33169cf8cd
Fix zwave_js Notification CC sensors and binary sensors (#46072)
* only include property key name in sensor name if it exists

* add endpoint to binary_sensor and sensor notification CC entities if > 0

* refactor to have helper method generate name

* change default behavior of generate_name

* return value for notification sensor when we can't find the state

* store generated name
2021-02-05 23:36:42 +01:00
Martin Hjelmare
c93fec34b3
Fix zwave_js sensor device class attribute error (#45863) 2021-02-02 16:25:43 +01:00
Marcel van der Veldt
0feda9ce63
Fix sensor discovery for zwave_js integration (#45834)
Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
2021-02-02 10:06:09 +01:00
kpine
d7a0f1e467
Include config entry id in zwave_js signal names (#45282) 2021-01-19 16:40:01 +01:00
Petro31
3ebc5d45a8
Add energy and power sensor tests & fix device_class (#45122) 2021-01-13 15:37:54 -05:00