Commit Graph

21 Commits

Author SHA1 Message Date
epenet eafece3651
Add setup type hints (part 1) (#63955)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-12 08:49:46 +01:00
Alexei Chetroi 997809c6c4
Refactor ZHA entity matching process (#60063)
* Group multi-matches by channels

* Group multi-matched by explicit groups

* Registryless AnalogInput and PowerConfiguration

* Refactor single cluster sensor registry

* Refactor single cluster cover and lock registry

* Refactor single cluster binary_sensor registry

* Pylint
2021-12-12 07:52:49 -05:00
David F. Mulcahey abbde8f128
Clean up state class and device class usage in ZHA (#61049)
* Clean up sensor and device class usage in ZHA

* additional cleanup

* Use EntityCategory
2021-12-11 11:51:24 -05:00
David F. Mulcahey f6ac856b8d
Use async_on_unload from config entry in ZHA (#61015)
* remove DATA_ZHA_DISPATCHERS

* update typing information

* fix rebase
2021-12-11 11:50:03 -05:00
David F. Mulcahey a17031630f
Use Platform enum in ZHA (#61016) 2021-12-11 11:06:39 -05:00
Franck Nijhof 258b388f41
Collection of changing entity properties to class attributes (#51248)
* Collection of changing entity properties to class attributes

* Apply suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-05-31 10:50:11 +02:00
Michael 9eecd90afc
Add constructor return type in integrations T-Z (#50899) 2021-05-20 17:00:19 +02:00
Marc Mueller dcca29ef68
Update typing 14 (#48078) 2021-03-18 15:08:35 +01:00
Marc Mueller 16dcbf1467
Update pylint (#47205) 2021-02-28 22:09:01 -10:00
David F. Mulcahey d5a03b4d6a
Cleanup async_accept_signal in ZHA (#38009) 2020-07-20 07:04:57 -07:00
Alexei Chetroi fe45935f38
Implement Keen vents as zha cover devices (#36080)
* Implement Keen vents as cover devices

* Update homeassistant/components/zha/cover.py
2020-05-24 11:10:16 -04:00
Alexei Chetroi f4c5b9f8f8
Add ZHA roller shadows as cover instead of switch (#36059)
* Implement cover for "Shade" ZHA device type.
* Update ZHA cover tests.
* Add stop command
* Coverage.
2020-05-23 22:37:49 -04:00
Erik Montnemery 8c5c963b96
Rename CoverDevice to CoverEntity (#34595) 2020-04-25 18:07:15 +02:00
Alexei Chetroi 81cef9a281
Split ZHA device loading and entities adding (#33075)
* Split ZHA device loading and entities adding.
Load zha devices from ZHA gateway, but add entities after integration
was setup.

* Use hass.loop.create_task()
* Split ZHA device initialization from loading.
Restore and initialize ZHA devices separately.

* Use hass.async_create_task()
Load devices prior group initialization.
2020-03-21 13:25:43 -04:00
David F. Mulcahey 4248893007
Clean up custom polling in ZHA device and light (#32653)
* cleanup timer handle when device is removed

* separate unavailable times for mains vs battery

* better name

* remove light refresh handle when removing light

* remove unused parallel updates

* don't steal HA const for different purpose

* don't flood network every hour for lights

* update test to test both intervals

* add test for light refresh interval

* fix tests

* update test

* put parallel updates back for now...

* fix async_schedule_update_ha_state usage

* review comment

* review comment

* update test - review conversation

* review comments

* await count not call count

* flip some state
2020-03-11 07:17:53 -04:00
Alexei Chetroi 20333703c5
Remove ZHA attribute listening channel (#32468)
* remove AttributeListeningChannel
* pull sleeps
* update signature to fix pylint
2020-03-04 13:11:53 -05:00
Alexei Chetroi 3385893b77
ZHA device channel refactoring (#31971)
* Add ZHA core typing helper.
* Add aux_channels to ZHA rule matching.
* Add match rule claim_channels() method.
* Expose underlying zigpy device.
* Not sure we need this one.
* Move "base" channels.
* Framework for channel discovery.
* Make DEVICE_CLASS and REMOTE_DEVICE_TYPE default dicts.
* Remove attribute reporting configuration registry.
* Refactor channels.
- Refactor zha events
- Use compound IDs and unique_ids
- Refactor signal dispatching on attribute updates

* Use unique id compatible with entities unique ids.
* Refactor ZHA Entity registry.
Let match rule to check for the match.

* Refactor discovery to use new channels.
* Cleanup ZDO channel.
Remove unused zha store call.

* Handle channel configuration and initialization.
* Refactor ZHA Device to use new channels.
* Refactor ZHA Gateway to use new discovery framework.
Use hass.data for entity info intermediate store.

* Don't keep entities in hass.data.
* ZHA gateway new discovery framework.
* Refactor ZHA platform loading.
* Don't update ZHA entities, when restoring from zigpy.
* ZHA entity discover tests.
* Add AnalogInput sensor.
* Remove 0xFC02 based entity from Keen smart vents.
* Clean up IAS channels.
* Refactor entity restoration.
* Fix lumi.router entities name.
* Rename EndpointsChannel to ChannelPool.
* Make Channels.pools a list.
* Fix cover test.
* Fix FakeDevice class.
* Fix device actions.
* Fix channels typing.
* Revert update_before_add=False
* Refactor channel class matching.
* Use a helper function for adding entities.
* Make Pylint happy.
* Rebase cleanup.
* Update coverage for ZHA device type overrides.
* Use cluster_id for single output cluster registry.
* Remove ZHA typing from coverage.
* Fix tests.
* Address comments.
* Address comments.
2020-02-21 18:06:57 -05:00
Paulus Schoutsen e9e44dbd97
Fix callback and async (#31281)
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
Bill Durr e16e192b3c improvements to zha cover (#31144) 2020-01-25 13:20:59 -05:00
Franck Nijhof fb35d382e1
Remove all empty *_setup_platform() from integrations (#31025)
* Remove all empty *_setup_platform() from integrations

* Fix tests for smartthings

* Fix tests for heos
2020-01-21 12:38:38 +01:00
Bill Durr 4d6417295b ZHA cover device support (#30639)
* ZHA cover device support
* flake8
* flake8, black
* isort
* pylint
* more test
* use zigpy provided functions
* black
* handle command errors, better state handling
* black
* more test
* lint
* Update ZHA cover tests coverage.
Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-01-11 22:42:14 -05:00