Commit Graph

686 Commits (47f016b340fd386bab0b77ce2a42564f86c11ac2)

Author SHA1 Message Date
David F. Mulcahey e29eb4fa23 fix device class lookup for binary sensors (#22724) 2019-04-04 09:06:54 -04:00
Paulus Schoutsen cfe4cf30ad
Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Tobias Sauerwein 048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Alexei Chetroi 625c8e0cee
Shutdown ZHAGateway on hass closing. (#22646)
* Shutdown ZHAGateway on hass stop.
* Cleanup ZHA event leftovers.
2019-04-03 09:40:48 -04:00
Alexei Chetroi 0427154963 Don't force updates on ZHA Electrical Measurement sensor. (#22647) 2019-04-02 08:28:55 -07:00
damarco c0ce86fa8e Bump zigpy (#22545) 2019-03-29 14:01:51 -07:00
David F. Mulcahey 6401920019 clean up channel configuration (#22534) 2019-03-29 16:41:04 -04:00
David F. Mulcahey 6dc127780e Do not use zha default light polling (#22513)
* don't use default light polling

* review comment
2019-03-29 16:52:13 +01:00
Paulus Schoutsen 9d21afa444 Update translations 2019-03-27 21:32:58 -07:00
Alexei Chetroi e670491c86 Targeted ZHA permit joins. (#22482)
* Targeted ZHA permit service.

* Convert IEEE string to EUI64 usiv vol schema.

* Update test units.

* Lint.

isort imports.
2019-03-27 19:50:52 -07:00
Jason Hu 7519e8d417 Update translate, fix dev build error (#22419) 2019-03-26 07:48:26 -07:00
David F. Mulcahey 3cca3c37f0 zha fixes (#22381) 2019-03-26 09:17:43 -04:00
Paulus Schoutsen 72bb94de96 Update translations 2019-03-21 12:57:20 -07:00
Alexei Chetroi 03855c18fc add ZHA channel name property (#22218)
* Make channel name a property.

* Cleanup Zigbee channels.

Use zcl.Cluster.ep_attribute as default channel name.
2019-03-21 07:40:12 -07:00
Alexei Chetroi 9653544144 Fix ZHA force polled entities. (#22222)
## Description:
Fix "force_polled" ZHA entities.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-20 19:15:21 -07:00
David F. Mulcahey 46ece3603f Add dynamic subscription for ZHA add device page (#22164)
* add ws subscription for zha gateway messages
* add debug mode
* only relay certain logs
* add missing require admin
* add devices command
* add area_id
* fix manufacturer code
2019-03-18 22:35:03 -04:00
David F. Mulcahey 89c96279ce Cleanup remaining constants stuff in ZHA (#22050)
* clean up constants
* fix quirks until it can be upgradded
2019-03-14 21:00:49 -04:00
Alexei Chetroi 9575c20b7c Minor ZHA consts fixes (#22049)
* Use consts for zha.core.consts

* Fix ZHA battery reporting config.
2019-03-14 20:29:12 -04:00
David F. Mulcahey 300384410f
Refactor ZHA gateway into modules and add admin protections to API (#22023)
* refactor

* cleanup

* fix tests

* admin all the things
2019-03-14 10:20:25 -04:00
David F. Mulcahey 5ffb471198 Update ZHA state handling (#21866)
* make device available if it was seen within 2 hours

* more state restore

* cleanup init

* clean up storage stuff

* fix tests

* update state handling
2019-03-09 20:09:09 -08:00
David F. Mulcahey ac5ccd651c Bump quirks for ZHA and handle resulting battery % change (#21869)
* bump quirks and handle battery change

* move inside guard

* round battery
2019-03-09 12:14:58 -08:00
roblandry e10e27d809 Add SmartThingsAccelCluster to ZHA binary_sensor (#21609)
* Add SmartThingsAccelCluster to binary_sensor

* Make corrections per discussion with @dmulcahey

* Add missing const to gateway.py

* Remove Acceleration from no sensor
2019-03-04 15:56:05 -08:00
David F. Mulcahey fc07d3a159 Add storage helper to ZHA and use it for the device node descriptor (#21500)
* node descriptor implementation

add info to device info

disable pylint rule

check for success

* review comments

* send manufacturer code for get attr value for mfg clusters

* ST report configs

* do zdo task first

* add guard

* use faster reporting config

* disable false positive pylint
2019-03-03 21:22:42 -08:00
David F. Mulcahey 45316f6ed6 ZHA fixes (#21592)
* do not report on 0x1000 LightLink cluster
* don't flood Zigbee network during configuration or initialization
* add lifeline of 60 minutes to lights
* use ootb polling
2019-03-02 14:09:01 -05:00
Diogo Gomes ed2b9e5483 Centrally define Watt (#21570)
* centralize Watt definition

* lint
2019-03-02 11:29:59 +01:00
David F. Mulcahey cd6c923123 fix exception (#21571) 2019-03-01 20:15:36 -05:00
damarco 1a9dcaefd2 Bump zigpy-deconz (#21566) 2019-03-01 13:47:20 -05:00
David F. Mulcahey b39846fb6b add friendly name to devices in the device registry (#21499)
switch to name_by_user

review comments

add device reg info to zha device api
2019-03-01 08:11:24 -05:00
David F. Mulcahey aa30ac52ea
prevent duplicate event channel registration (#21534) 2019-02-28 22:53:59 -05:00
David F. Mulcahey 901b2b4ba3
new websocket api way (#21533) 2019-02-28 19:32:41 -05:00
David F. Mulcahey 82bdd9568d Add direct binding for remotes and lights for ZHA (#21498)
* cluster matching and binding apis

implement binding

callback

fix loop

fix loops

* review comments

* use any because it is clearer
2019-02-28 10:04:35 -08:00
Paulus Schoutsen 78217fa9b0 Update translations 2019-02-27 16:34:13 -08:00
Alexei Chetroi 9066609d23 Refactor async_turn_on() for ZHA Light. (#21156)
* Refactor async_turn_on() for ZHA Light.

Use "move_to_level_with_on_off" if brightness or transition attributes
are present in the service call data, otherwise issue "On" Zigbee
command.
Allow brightness of 0 for service call -- effectively turning the light
off.
Send color commands only after the light was turned on.

* Fix zha.light tests.
2019-02-27 08:34:38 -05:00
David F. Mulcahey a34524febe Clean up ZHA post rewrite (#21448)
* update async handling to reduce unnecessary coroutine creation

* lint

* cleanup
2019-02-26 10:48:10 -08:00
Paulus Schoutsen 3fcbc36abe Update translations 2019-02-21 16:40:25 -08:00
David F. Mulcahey a2877c4ea0
update services.yaml (#21276) 2019-02-21 14:39:55 -05:00
David F. Mulcahey 0f8575f939 Fix ZHA bugs (#21246)
* fix bugs

* add comment

* allow entities to be marked unavailable
2019-02-21 14:20:58 +01:00
damarco 1518a80069 Bump zigpy (#21203)
* Bump zigpy

* Update requirements

* Update test requirements

* Bump zigpy-deconz
2019-02-20 16:34:59 +01:00
David F. Mulcahey cece6454e4 Fix bug in ZHA and tweak non sensor channel logic (#21234)
* fix race condition and prevent profiles from stealing channels

* fix battery voltage
2019-02-20 16:33:29 +01:00
David F. Mulcahey 5b24b271cc Don't dispatch to components when there are no channels for ZHA sensors (#21223)
* don't dispatch when channels don't exist

* review comment
2019-02-20 16:27:03 +01:00
David F. Mulcahey 3be8178035 Refactor ZHA listeners into channels (#21196)
* refactor listeners to channels

* update coveragerc
2019-02-19 09:58:22 -08:00
David F. Mulcahey 3f9e6a7064 Add power source to device and clean up zha listeners (#21174)
check available and add comments

ensure order on API test
2019-02-18 16:55:41 +01:00
David F. Mulcahey 3a6a246746
Set ZHA device availability on new join (#21066)
* set availability on device join

* fix new join test
2019-02-15 13:14:58 -05:00
Paulus Schoutsen 02f207ea8e Update translations 2019-02-13 15:44:18 -08:00
David F. Mulcahey d692251e62
Run tasks when ZHA devices become available (#20998)
* use tasks for message interception

* update available handling

* review comments and cleaned up check

* review comments
2019-02-13 08:52:29 -05:00
David F. Mulcahey 561ff33641
Update entity state when ZHA device becomes available (#20993)
* correctly update device entity state

* update state when device becomes available

* constants

* review comments
2019-02-12 20:37:39 -05:00
David F. Mulcahey 80442e655d
Update ZHA API to be device oriented (#20990)
* update cluster API

* swap to device focused API

* update test
2019-02-12 15:05:02 -05:00
David F. Mulcahey 868820c424
add device info API (#20950) 2019-02-11 14:38:04 -05:00
David F. Mulcahey 16154ab445 Update ZHA helpers (#20898)
* update helpers

* review comments

* remove ternary

* use correct timeout
2019-02-10 19:01:07 +01:00
David F. Mulcahey 898b699311 Add quirks info to ZHA device (#20923)
* add quirks info to zha device

* move import

* remove device entity part
2019-02-10 08:56:27 -06:00
David F. Mulcahey 32f2221b22 Fix zha light bugs (#20825) 2019-02-08 00:09:47 +01:00
David F. Mulcahey d177e1324c Add device ieee to zha events (#20791) 2019-02-07 16:31:24 +01:00
David F. Mulcahey d4c34c6b02 Cleanup zha listener lifecycle (#20789) 2019-02-07 09:23:01 +01:00
David F. Mulcahey 03ab152c82 Enable the available property for zha entities (#20788) 2019-02-07 09:14:19 +01:00
David F. Mulcahey e6cd04d711
ZHA component rewrite (#20434)
* rebase reorg

* update coveragerc for now

* sensor cleanup

* remove availability tracking for entities

* finish removing changes from tests

* review comments pass 1

* use asyncio.gather - review comments

* review comments

* cleanup - review comments

* review comments

* review comments

* cleanup

* cleanup - review comments

* review comments

* review comments

* use signal for removal

* correct comment

* remove entities from gateway

* remove dead module

* remove accidently committed file

* use named tuple - review comments

* squash bugs

* squash bugs

* add light and sensor back to coveragerc until % is higher
2019-02-06 13:33:21 -05:00
Paulus Schoutsen c2eec16721 Update translations 2019-02-02 14:12:23 -08:00
David F. Mulcahey ed75549123
ZHA component rewrite part 4 - add device module (#20469)
* add device module

* spelling

* review comments

* filter out endpoint id 0 (ZDO)

* review comments

* change name

* remove return
2019-01-30 16:44:22 -05:00
David F. Mulcahey 34090bd021 ZHA component rewrite part 3 - update helpers (#20463)
* update helpers

* address comments

* remove ieee

* cluster id as hex too
2019-01-28 16:40:00 -08:00
David F. Mulcahey 05d41bc0ee
introduce gateway (#20460) 2019-01-26 13:28:13 -05:00
David F. Mulcahey a0b93c2add
ZHA component rewrite part 1 (#20456)
* rearrange files

* add init to module

* update imports

* update coveragerc

* put blank line back... git raw view be damned
2019-01-26 08:54:49 -05:00
damarco b557157ea1 Add support for deconz radios to zha component (#20167)
* Add support for deconz radios

* Update check_zigpy_connection()
2019-01-16 16:09:09 -08:00
David F. Mulcahey 8748ace244 Make imports relative in ZHA component (#20020)
* make imports relative

* remove cyclic import
2019-01-16 11:06:22 -08:00
Alexei Chetroi 4b3d4b275e Zha light.turn_on service fixes. (#20085)
Set color only if light supports color mode.
Set color temp only light supports color temp.
Update entity's brightness only if Zigbee command to set the brightness
was sent successfuly.
2019-01-15 16:12:22 -08:00
David F. Mulcahey 012e91f9b1 version bump for zha-quirks (#20019) 2019-01-12 15:21:30 +01:00
David F. Mulcahey ba21608042 Repackage ZHA component (#19989)
* move files

* rename files

* rename files

* move files

* relative import

* update coveragerc
2019-01-11 20:34:48 -08:00
Alexei Chetroi 5ab3c7b765 Don't set friendly_name in Zha entity. (#19991)
Use @property name instead of setting friendly_name device state attr.
2019-01-11 21:41:27 -05:00
David F. Mulcahey 7be015fcc6 Add services and helper functions to support a config panel for ZHA (#19664)
* reconfigure zha device service

add log line to reconfigure service for consistency

* add entity functions to support new services

* added new services and web socket api and split them into their own module

* support manufacturer code

logging to debug

get safe value for manufacturer

* update services.yaml

* add comma back

* update coveragerc

* remove blank line

* fix type

* api cleanup - review comments

* move static method to helpers - review comment

* convert reconfigure service to websocket command - review comment

* change path

* fix attribute
2019-01-11 11:34:29 -08:00
Alexei Chetroi d859c3fa86 Don't map LevelControl to light for single cluster devices. (#19929) 2019-01-10 14:43:24 -05:00
Paulus Schoutsen 9aed40a88d Update translations 2019-01-09 15:29:31 -08:00
David F. Mulcahey acdf9c7ce2 Relay events for onoff and levelcontrol output clusters in ZHA (#19863)
* auto relay events for onoff and levelcontrol output clusters

* fix docstring

* correct copy/paste failure - review comment

* add space - review comment
2019-01-08 17:20:50 +01:00
Alexei Chetroi ed8f89df74 Use manufacturer id only for configure_reporting only when specified. (#19729) 2019-01-04 16:05:37 -05:00
David F. Mulcahey ef180c489a check config instead of config_entry for quirks flag (#19730) 2019-01-04 14:00:26 -05:00
David F. Mulcahey d0742cb332 Only bind clusters in ZHA remote entity (#19577)
* split bind and configure reporting helpers

* only bind remote clusters

* update comments - review comment
2018-12-29 16:17:17 -08:00
David F. Mulcahey bef85ecd2e Remove global from ZHA application controller (#19557)
* remove global from application controller per request

* remove unneeded line

* don't store controller application in hass.data - review comment
2018-12-25 09:20:09 +01:00
Alexei Chetroi 4a1da0b041 Configure ZHA entity on new ZHA device join (#19470)
* Address PR#19177 comments.

* Make 'new_join' part of ZhaEntity.

Call async_configure() automatically when new device ZHA device joins.
2018-12-23 20:47:06 +01:00
David F. Mulcahey 50888ae339 Fix issues in ZHA light (#19368)
* make light report on/off and level

* refactoring and review comments

* refactor

* use boolean for set_state - review comment

* async_schedule_update_ha_state() on level change - review comment

* fix docstring - review comment
2018-12-23 16:16:21 +01:00
Alexei Chetroi 01fc322488 Make ZHA entities non-polled by default (#19536) 2018-12-23 11:11:24 +01:00
David F. Mulcahey 2a2af80309 Add ZHA occupancy sensor (#19365)
* occupancy sensor

* lint

* map occupancy cluster to binary_sensor

* update to use reporting configuration and async_configure

* refactor

* fix typo - review comment

* handle restore entity functionality
2018-12-22 20:53:15 +01:00
David F. Mulcahey 4bdb21a871 Update ZHA entity state on ZigBee zdo device announce (#19208)
* call async_update if defined on device_announce

* lint

* change update method

* remove unneeded listener
2018-12-22 18:18:48 +01:00
David F. Mulcahey b444dfe8a6 Add ZHA battery sensor (#19363)
* add batery sensor

* add additional battery sizes

* remove blank line

* lint

* fix attribute report configuration

* return None - review comments
2018-12-22 09:11:33 +01:00
Alexei Chetroi 4692605974 ZHA entity ZCL reporting configuration (#19177)
* Implement async_configure() method for ZHA entities.

Allow attribute reporting configuration to be stored as dict of zha
entity.

* Update ZHA platform to use new attribute reporting configuration.

* Use const declaration instead of magic numbers.

* Add support for manufacturer_id in ZCL attribute reporting configuration.

* Refactor async_configure() method.

Rename attribute reporting dict to zcl_reporting_config.
2018-12-19 14:52:20 +01:00
damarco f60f9bae00 Always add friendly name attribute to ZHA entities (#19141)
* Always add friendly name attribute

* Only change device_info name
2018-12-13 23:08:35 +01:00
David F. Mulcahey 031ee71adf Add ZHA device handler library (#19099)
* event foundation

* implement quirks

* lock zha-quirks version

* allow quirks handling to be toggled on and off

* revert event commit

* disable warning

* update requirements_all

* Remove fix in favor of #19141

#19141 should be what ultimately corrects this issue.

* review comment
2018-12-12 17:06:22 +01:00
David F. Mulcahey f4f42176bd ZHA - Event foundation (#19095)
* event foundation

* add missing periods to comments

* reworked so that entities don't fire events

* lint

* review comments
2018-12-10 10:59:50 -05:00
Paulus Schoutsen fe2d24c240 Update translations 2018-12-10 09:54:12 +01:00
Paulus Schoutsen 83311df933 Add translations 2018-12-06 00:30:33 +01:00
Alexei Chetroi 3e1ab1b23a Sort import order of zha component. (#18993) 2018-12-04 11:38:57 +01:00
damarco 1ae58ce48b Add support for zha device registry (#18755) 2018-12-01 10:31:49 +01:00
damarco 052d305243 Add config entry for ZHA (#18352)
* Add support for zha config entries

* Add support for zha config entries

* Fix node_config retrieval

* Dynamically load discovered entities

* Restore device config support

* Refactor loading of entities

* Remove device registry support

* Send discovery_info directly

* Clean up discovery_info in hass.data

* Update tests

* Clean up rebase

* Simplify config flow

* Address comments

* Fix config path and zigpy check timeout

* Remove device entities when unloading config entry
2018-11-27 21:21:25 +01:00
David F. Mulcahey 67aa76d295 Refactor ZHA (#18629)
* refactor ZHA

* lint

* review request

* Exclude more zha modules from coverage
2018-11-22 19:00:46 +01:00
rafale77 f76ccb636c Add support for various load level devices (#18161) 2018-11-03 22:25:05 +01:00
Hedda ad3d7c9523 Update zha __init__.py to reflect new Zigbee name stylization by the Zigbee Alliance (#17751)
Zigbee Alliance has changed their stylized writing (and logo) of the Zigbee name from “ZigBee” to “Zigbee”, as in they are no longer writing Zigbee with a capital “B” in the middle of the name.
2018-10-24 14:12:30 +02:00
damarco 5167658a1d Add support for zha custom cluster mappings (#16714)
* Add support for custom cluster mappings

* Refactor sub_component mapping
2018-10-09 12:53:02 +02:00
cdce8p 7f0a50ce31 async_create_task (#17059)
* async_create_task

* Update google.py
2018-10-02 11:03:09 +02:00
damarco 1c251009fe Add zha device entity (#14579)
* Add endpoint entity

* Fix lint error

* Add nwk address as device state attribute

* Change to ZhaDeviceEntity

* Show last_seen only if offline

* Remove obsolete _discover_endpoint_info()
2018-09-17 10:42:21 +02:00
Alexei Chetroi 44fdfdf695 Log raw result of configure_reporting() command. (#16655) 2018-09-17 07:45:44 +02:00
Alexei Chetroi 7a52bbdf24 Allow only_cache parameter in zha.safe_read() (#16553)
* Allow only_cache parameter in zha.safe_read()

* Use cache_only for binary_sensor.zha initial update.

* Use cache_only for fan.zha initial update.

* Use cache_only for sensor.zha initial update.

* Use cache_only for switch.zha initial update.

* Use cache_only for light.zha initial update.

* Refactor cached only read in zha platform.
2018-09-13 09:22:50 +02:00
Alexei Chetroi f2203e52ef Add configure_reporting() method to zha component (#16487)
* Add zha.configure_reporting() method.

Binds a cluster and configures reporting for the specified attribute.

* git add homeassistant/components/binary_sensor/zha.py

* Refactor sensor.zha to use new 'configure_reporting() method.

* Zha configure reporting - switch (#1)

* use configure_reporting for zha switch

* lint fixes

* Rename variables/classes to properly reflect the content
2018-09-13 09:11:47 +02:00
Alexei Chetroi 117ea9e553 Refactor zha/async_device_initialized(). (#16485)
Leverage endpoint.model and endpoint.manufacturer properties
2018-09-12 11:39:23 +02:00
Russell Cloran ba63a6abc0
zha: Bump to zigpy 0.2.0/bellows 0.7.0 (#16404) 2018-09-03 22:46:27 -07:00
Ville Skyttä dd9d53c83e Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0 (#14557)
* Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0

* Pydocstyle D401 fixes
2018-08-24 10:28:43 +02:00
David F. Mulcahey eae9726bec Add electrical measurement sensor to ZHA (#14561)
* Add electrical measurement sensor

* correct state update

* hound fix

* zha: Add metering sensor (#14562)

* Add IlluminanceMeasurementSensor to ZHA (#14563)

* add IlluminanceMeasurementSensor

* address review comment

* Fix whitespace error during merge

* Add electrical measurement sensor

* correct state update

* hound / flake8
2018-05-26 22:50:05 +02:00
Russell Cloran 9791c6b21b
zha: Bump to zigpy-xbee 0.1.1 (#14566) 2018-05-20 21:57:09 -07:00
David F. Mulcahey a183043d5d Add IlluminanceMeasurementSensor to ZHA (#14563)
* add IlluminanceMeasurementSensor

* address review comment

* Fix whitespace error during merge
2018-05-20 21:56:41 -07:00
David F. Mulcahey b489519930 zha: Add metering sensor (#14562) 2018-05-20 16:01:56 -07:00
Russell Cloran 2f74ffcf81 zha: Fix cluster class check in single-cluster device type (#14303)
zigpy now allows custom devices, which might mean that devices have cluster
objects which are not instances of the default, but may be instances of
sub-classes of the default. This fixes the check for finding single-cluster
device entities to handle sub-classes properly.
2018-05-14 16:50:09 +02:00
damarco 01ce43ec7c Use None as initial state in zha component (#14389)
* Return None if state is unknown

* Use None as initial state
2018-05-12 14:41:44 +02:00
damarco e963fc5acf Add support for pressure sensors (#14361) 2018-05-10 23:55:32 +02:00
damarco 6e831138b4 Fix binary_sensor async_update (#14376) 2018-05-10 10:59:23 -07:00
Russell Cloran 63cc179ea2 zha: Bump to zigpy 0.1.0 (#14305) 2018-05-06 11:17:05 +02:00
Russell Cloran 9d4d1c8233 zha: Clean up binary_sensor listener registration/state updates (#14197)
- Instead of registering listeners in the entity __init__, do it in
   async_added_to_hass to avoid errors updating an entity which isn't fully
   set up yet
 - Change from schedule_update_ha_state to async_schedule_update_ha_state
2018-05-01 08:55:25 -04:00
Russell Cloran 02a12a0bb4
zha: Support remotes/buttons (#12528) 2018-04-29 23:31:27 -07:00
Russell Cloran 2707d35a86
Update bellows to 0.5.2 (#13800) 2018-04-10 00:12:22 -07:00
Igor Bernstein 9cb3c9034f Zigbee fan (#12289)
* wip: initial control

* fix initial state

* cosmetic cleanup

* doc typo

* lint

* fixes

* fix unknown bug

* Lint
2018-03-18 09:17:56 -07:00
Per Osbäck f9e07e617c update to async/await (#13137) 2018-03-12 13:57:13 -07:00
Anders Melchiorsen e2e10b91a7 Grammar fix 'an unique' (#12870) 2018-03-03 19:23:55 +01:00
Paulus Schoutsen dc8c331c68
Update ZHA deps (#12737) 2018-02-27 00:05:29 -08:00
Russell Cloran 63fcf9d425 zha: Add support for humidity sensors (#12496)
* zha: Add support for humidity sensors

* Fix lint issue
2018-02-18 15:03:18 -08:00
Russell Cloran 17b57099ae zha: Simplify unique ID (#12495)
Also fixes entity IDs generated for devices on the same endpoint.
2018-02-18 15:02:34 -08:00
Paulus Schoutsen 3fd61d8f45 Update voluputous (#12463)
* Update voluputous

* Fix http config

* Fix optional with default=None

* Optional, default=none

* Fix defaults in voluptuous schemas

* Fix tests

* Fix update error

* Lint
2018-02-17 10:29:14 +01:00
Igor Bernstein 612dd30201 Stop mapping zigbee switches to lights & switches. (#12280)
Zigbee switches only contain client clusters that are meant to control server clusters on a different device/endpoint.
This device type -> cluster mapping can be found in https://www.nxp.com/docs/en/user-guide/JN-UG-3076.pdf.
The intended usage is of connecting client clusters to server clusters is described in https://products.currentbyge.com/sites/products.currentbyge.com/files/document_file/DT200-GE-Zigbee-Primer-Whitepaper.pdf

The lack of server clusters on switches has been verified using a GE ZigBee Lighting Switch 45856GE and a 45857GE dimmer.

Output from a 45856GE:
Device:
  NWK: 0x0cd8
  IEEE: 00:22:a3:00:00:1f:37:68
  Endpoints:
    1: profile=0x104, device_type=DeviceType.ON_OFF_LIGHT
      Input Clusters:
        Basic (0)
        Identify (3)
        Groups (4)
        Scenes (5)
        On/Off (6)
        Metering (1794)
        Diagnostic (2821)
      Output Clusters:
        Time (10)
        Ota (25)
    2: profile=0x104, device_type=DeviceType.ON_OFF_LIGHT_SWITCH
      Input Clusters:
        Basic (0)
        Identify (3)
        Diagnostic (2821)
      Output Clusters:
        Identify (3)
        On/Off (6)
2018-02-15 14:51:54 -08:00
Russell Cloran ad8fe8a93a zha: Add unique_id to entities (#12331)
* zha: Add unique_id to entities

* Lint

* fix comments

* Update __init__.py

* Update __init__.py
2018-02-15 13:38:56 +01:00
Russell Cloran 3b3050434a zha: Add remove service (#11683)
* zha: Add remove service

* Lint
2018-02-11 20:34:19 -08:00
Russell Cloran 28ed304c93 zha: Update zigpy-xbee to 0.0.2
0.0.2 implements auto_form, so that configuring the radio to be a
controller is done automatically.
2018-02-11 14:45:52 -08:00
Russell Cloran c7dad113d9 zha: Add support for XBee radios (#12205)
* zha: Add support for xbee radios

* Lint
2018-02-06 10:46:28 -08:00
Russell Cloran f58e5f442d zha: Update to bellows 0.5.0+zigpy (#12187) 2018-02-05 16:05:19 -08:00
Russell Cloran ff32f90a29 Fix zha color probe (#11670) 2018-01-15 14:25:59 -08:00
Anders Melchiorsen 8267a21bfe Lazy loading of service descriptions (#11479)
* Lazy loading of service descriptions

* Fix tests

* Load YAML in executor

* Return a copy of available services to allow mutations

* Remove lint

* Add zha/services.yaml

* Only cache descriptions for known services

* Remove lint

* Remove description loading during service registration

* Remove description parameter from async_register

* Test async_get_all_descriptions

* Remove lint

* Fix typos from multi-edit

* Remove unused arguments

* Remove unused import os

* Remove unused import os, part 2

* Remove unneeded coroutine decorator

* Only use executor for loading files

* Cleanups suggested in review

* Increase test coverage

* Fix races in existing tests
2018-01-07 14:54:16 -08:00
Russell Cloran 7596ac23fc zha: Update to bellows 0.4.0 (#9890)
Fixes: #8822
2017-10-15 21:41:16 -07:00
Michael Prokop 08b0629eca Fix a bunch of typos (#9545)
s/Addres /Address /
s/Chnage/Change/
s/Converion/Conversion/
s/Supressing/Suppressing/
s/agains /against /
s/allready/already/
s/analagous/analogous/
s/aquired/acquired/
s/arbitray/arbitrary/
s/argment/argument/
s/aroung/around/
s/attibute/attribute/
s/auxillary/auxiliary/
s/befor /before /
s/commmand/command/
s/conatin/contain/
s/conection/connection/
s/coresponding/corresponding/
s/entites/entities/
s/enviroment/environment/
s/everyhing/everything/
s/expected expected/expected/
s/explicity/explicitly/
s/formated/formatted/
s/incomming/incoming/
s/informations/information/
s/inital/initial/
s/inteface/interface/
s/interupt/interrupt/
s/mimick/mimic/
s/mulitple/multiple/
s/multible/multiple/
s/occured/occurred/
s/occuring/occurring/
s/overrided/overridden/
s/overriden/overridden/
s/platfrom/platform/
s/positon/position/
s/progess/progress/
s/recieved/received/
s/reciever/receiver/
s/recieving/receiving/
s/reponse/response/
s/representaion/representation/
s/resgister/register/
s/retrive/retrieve/
s/reuqests/requests/
s/segements/segments/
s/seperated/separated/
s/sheduled/scheduled/
s/succesfully/successfully/
s/suppport/support/
s/targetting/targeting/
s/thats/that's/
s/the the/the/
s/unkown/unknown/
s/verison/version/
s/while loggin out/while logging out/
2017-09-23 17:15:46 +02:00
Russell Cloran 8d31c5fbf6 zha: Update to bellows 0.3.4 (#8594) 2017-07-21 21:22:43 -07:00
Russell Cloran 2f474a0ed8 zha: Handle both input and output clusters (#8410)
bellows 0.3.0 changes the API to have both, renaming the attribute which used
to be for input clusters in the process.

This is in preparation for remotes.
2017-07-10 21:16:44 -07:00
Russell Cloran 46ce26eb7a zha: Try multiple reads to get manufacturer/model (#8308)
Some devices don't seem to return the information properly when asked for
multiple attributes in one read. This separates out the reads if it didn't
work as expected the first time.

Because this data is cached in bellows, I don't expect any extra reads in
the "happy" case.
2017-07-06 23:02:22 -07:00
Russell Cloran 5cba3085b4 zha: Strip whitespace from device names (#8306) 2017-07-03 08:31:16 +02:00
Fabian Affolter 3ee4d1060f Update docstrings (#7361)
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update tomato.py

* Update isy994.py

* Lint + fix tests

* Lint
2017-04-29 22:04:49 -07:00
Russell Cloran d79f89e168 Add support for Zigbee Home Automation (#6263)
* Add support for Zigbee Home Automation

* Fewer magic numbers

* Make optional device config work

* Remove non-zha device_tracker stuff

* Always return boolean from is_on

* Only pass through JSON serializable discovery_info

* Update to bellows 0.2.4

* Fewer magic numbers in binary sensor

* Populate const structures from a function

* Update bellows to 0.2.6

* Fewer magic numbers in light

* Take all possible clusters when overriding

* Update bellows to 0.2.7
2017-04-24 22:24:57 -07:00