-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get zha switch and binary_sensor state on HA start #11429
Closed
Closed
Changes from 7 commits
Commits
Show all changes
165 commits
Select commit
Hold shift + click to select a range
41fbfb5
Get zha switch state on HA start
86e1d0f
Account for User-Agent being non-existent, causing a TypeError (#11064)
akatrevorjay f314b6c
Cloud Updates (#11404)
balloob bb2191b
Add support for the renaming of Yamaha Receiver Zones via configurati…
dfinlay 36c7fbe
Plex api update (#11423)
ryanm101 75a3935
fix: hmip-etrv-2 now working with homeassistant (#11175)
daenny ec700c2
Fix errors in zigbee push state (#11386)
eb00e54
Add on/off supported feature to climate (#11379)
andrey-git 65df6f0
Fix CONF_FRIENDLY_NAME (#11438)
cdce8p 4512a97
Climate: fix missing "|" (#11441)
andrey-git 2cf5acd
Google Assistant -> Google Actions (#11442)
balloob 04de226
Added new climate component from Daikin (#10983)
rofrantz 4628a20
Get zha binary_switch state on HA start
3436676
Updated generic thermostat to respect operation_mode and added away m…
ciotlosm 233e5ef
Lint fix
f54bba5
File permission revert
6cb0212
Reconnect to alarmdecoder on disconnect (#11383)
PhracturedBlue 367d849
Ensure state ignores unknown data types
5680611
Filter to alarm attributes
c69e9e4
Fix formatting
35f3505
Set tahoma cover scan interval to 60 seconds (#11447)
bakedraccoon b7c7041
Add some tests to the cloud component (#11460)
balloob 1e9e692
Input Select - Added service description (#11456)
cdce8p 642e9c5
Input Boolean - Deleted 'DEFAULT_INITIAL' (#11453)
cdce8p 1490ccf
Updated gitignore file (#11452)
cdce8p ebbdce1
Update hydroquebec component to use hass httpsession (#11412)
titilambert 5236b72
Catch everything when calling to OctoPrint API to fix #10557 (#11457)
65d841c
Update PULL_REQUEST_TEMPLATE.md (#11465)
Danielhiversen 71fb7a6
iOS 10 should be served javascript_version:es5 (#11387)
mnoorenberghe 3a00c3d
Version bump to 0.60.1
balloob 5820bab
Fix async IO in Sesame lock component. (#11054)
veleek e81d17d
Fix webdav calendar schema (#11185)
maxlaverse 2330268
homematic: add username and password to interface config schema (#11214)
jannau 9055922
Fix webostv select source (#11227)
OddBloke 794cfb7
Fix detection of if a negative node is in use (#11255)
OverloadUT 889eef7
Bugfix homematic available modus (#11256)
pvizeli 5a469f4
Support multiple Hue bridges with lights of the same id (#11259)
andreacampi 486263f
Fix inverted sensors on the concord232 binary sensor component (#11261)
CTLS f6a67d9
Fix handling zero values for state_on/state_off (#11264)
ziotibia81 a27b37b
Fix allday events in custom_calendars (#11272)
maxlaverse 5d64554
Fix unpredictable entity names in concord232 binary_sensor (#11292)
rwa d3ed6d5
Fix leak sensors always showing Unknown until Wet (#11313)
OverloadUT e0a1b87
Don't block on sevice call for alexa (#11358)
pvizeli b611971
iOS 10 should be served javascript_version:es5 (#11387)
mnoorenberghe 8b57777
Alexa to not use customize for entity config (#11461)
balloob c526fcd
Merge pull request #11470 from home-assistant/release-0-60-1
balloob 0189678
Merge branch 'master' into dev
balloob 455c629
Don't duplicate html5 registrations (#11451)
Chris-V 417c193
AlarmDecoder remove icon function as BinarySensorDevice handles it co…
hawk259 f21914d
Upgrade psutil to 5.4.3 (#11468)
fabaff c714658
Upgrade alpha_vantage to 1.8.0 (#11476)
fabaff ff9688b
Fix vultr tests (#11477)
balloob f6307a1
Upgrade yarl to 0.17.0 (#11478)
fabaff a0df165
Add Touchline climate platform (#10547)
abondoe b22a268
Upgrade pysnmp to 4.4.4 (#11485)
fabaff 3fbf09e
Add new iGlo component (#11171)
jesserockz c613585
Add missing configuration variables (#11390)
fabaff 5c2cecd
Clean up Alexa.intent and DialogFlow.intent (#11492)
balloob 939d1b5
Fix time functions would throw errors in python scripts (#11414)
tomwaters e42c485
Upgrade pywebpush to 1.5.0 (#11497)
Chris-V 4496ee5
upgrade schiene to 0.20 (#11504)
JulianKahnert c203247
timer: include the remaining time in the state attributes (#11510)
efb83dd
More tolerant KNX component if gateway cant be connected (#11511)
Julius2342 4a6b5ba
Snips (new) added speech response, parse snips/duration (#11513)
tschmidty69 3cbd77f
Add Dark Sky weather component (#11435)
DanNixon 8267a21
Lazy loading of service descriptions (#11479)
amelchio bccd880
Fix canary flaky test (#11519)
balloob c53fc94
Address missed review comments for Dark Sky weather (#11520)
DanNixon 8c0035c
New features for Owntracks device_tracker (#11480)
cpcowart 2ba9d82
Reconnect before mochad switch send command (#11296)
aosadchyy 46ad194
Fix Kodi channels media type (#11505)
florianj1 dff36b8
Extension sensor alpha_vantage (#11427)
ChristianKuehnel b1b0a25
MQTT json attributes (#11439)
0e71009
Support pushing all sensors and fix wrong metrics. (#11159)
michaelkuty e0e2f73
Add options feature to Baidu TTS. (#11462)
yienxu 903cda0
Insteon local update (#11088)
camrun91 13effee
Snips: (fix) support new intentName format (#11509)
tschmidty69 8b267e3
Upgrade numpy to 1.14.0 (#11542)
fabaff 10f48fb
Upgrade python-etherscan-api to 0.0.2 (#11535)
fabaff 8585888
Upgrade Sphinx to 1.6.6 (#11534)
fabaff 13042d5
ZoneMinder event sensor updates (#11369)
swilson 8313225
Move Google Assistant entity config out of customize (#11499)
balloob f56b3d8
Upgrade lightify to 1.0.6.1 (#11545)
fabaff cba5540
Improved test runtime (#11553)
cdce8p 92014bf
Add 2 media_player services and 1 custom service to Squeezebox platfo…
ericpignet cf04a81
Fix error on entity_config missing (#11561)
philk c4bc42d
Upgrade keyring to 10.3.2 (#11531)
fabaff 3cba09c
Coinbase.com sensor platform (#11036)
nkgilley 4dda842
Try to fix crashes after Hue refactoring (#11270)
andreacampi 88b70e9
Remove execution file perm (#11563)
balloob 9e0ca71
Deprecate explicit entity_id in template platforms (#11123)
amelchio 382a623
Update frontend to 20180110.0
balloob d793cfe
Update frontend to 20180110.0
balloob 0d06e8c
Test tweaks (#11560)
balloob 02979db
Add Velux Windows to Tahoma (#11538)
bakedraccoon c5d5d57
Extend hass.io services / updater (#11549)
pvizeli 6cc285a
Add sensibo_assume_state service to Sensibo climate (#11567)
andrey-git 60ce2b3
Tracking all groups to allow changing of existing groups (#11444)
randellhodges 5fda78c
Fix new squeezebox service descriptions for lazy loading (#11574)
amelchio 3972d1d
Mark REST binary_sensor unavailable if request fails (#11506)
DanNixon d2b6660
Tado improvements - hot water zone sensors and climate precision (#11…
andersonshatch cf612c3
Make the rpi_rf component thread-safe using an RLock (#11487)
ulido 7723db9
Update pyhomematic, support new devices (#11578)
danielperna84 dc5b610
Alarmdecoder add validation of the zone types (#11488)
hawk259 3bc6a7d
Support OSRAM lights on ZHA (#11522)
emlove a23f603
Fix bluetooth tracker source (#11469)
swilson 6b103cc
Fix for asuswrt, telnet not working and presence-detection for router…
kennedyshead a35d05a
Remove aux_heat support from Sensibo now that UI supports on/off (#11…
andrey-git 1235dae
Changed device type of media player and cover to switch (#11483)
Laqoore 6af42b4
Control ordering of display in history component (#11340)
rwa 9384e2c
Pr/11430 (#11587)
balloob ed66c21
Cast return values and add unit tests for the yahoo weather component…
cgtobi 2224d05
add velux roller shutter to tahoma (#11586)
bakedraccoon 965bd8a
Added support for enable/disable motion detection (#11583)
abjorshammar 4883036
Update frontend
balloob 88161cd
Avoid returning empty media_image_url string (#11557)
JackWindows 6918993
Fix state for trigger with forced updates (#11595)
emlove 8a301c6
Concord232 alarm arm away fix (#11597)
rwa dacd7cd
Core support for hass.io calls & Bugfix check_config (#11571)
pvizeli cc23652
Fix Tahoma stop command for 2 types of shutters (#11588)
bakedraccoon b8e4c2f
Snips add say and say_actions services (new) (#11596)
tschmidty69 c036141
Pushbullet email support (fix) (#11590)
tschmidty69 0409192
Bugfix and cleanup for Rfxtrx (#11600)
Danielhiversen be31a86
Xiaomi lib upgrade (#11603)
Danielhiversen b854cdb
Upgrade yarl to 0.18.0 (#11609)
fabaff 5656b0e
Upgrade keyring to 10.6.0 (#11608)
fabaff 37427d0
Upgrad youtube_dl to 2017.12.31 (#11610)
fabaff 5e81736
patch stop command (#11612)
bakedraccoon b2b836d
small sonos cleanup (#11607)
pvizeli e476b9d
Update Xiaomi Miio compontent broken URI (#11621)
keesschollaart81 2e08766
light/mqqt_json: allow brightness scaling (#11613)
jkoelker 3e43f4e
Adding support for Lutron covers (#11602)
nickovs ea62ded
Update Pyarlo to 0.1.2 (#11626)
arsaboo 5def6eb
Use kelvin/mireds correctly for setting iglo white (#11622)
jesserockz cdbf2f9
Hyperion: Add brightness, HDMI and effect support (#11543)
starkillerOG 9d67d22
Fixes and enhancements for the Tahoma platform (#11547)
glpatcern c33b171
upgrade xiaomi lib (#11629)
Danielhiversen 0550baa
Add templates to MQTT climate (#11623)
tinloaf 028597f
Update CODEOWNERS
pvizeli 688d706
Upgrade coinmarketcap to 4.1.2 (#11634)
fabaff 033e068
Avoid returning empty media_image_url string (#11557)
JackWindows f2cc00c
Core support for hass.io calls & Bugfix check_config (#11571)
pvizeli 1802c0a
Fix Tahoma stop command for 2 types of shutters (#11588)
bakedraccoon 92bec56
Pushbullet email support (fix) (#11590)
tschmidty69 b8dfa4c
Fix state for trigger with forced updates (#11595)
emlove 179d993
Snips add say and say_actions services (new) (#11596)
tschmidty69 8d19192
Concord232 alarm arm away fix (#11597)
rwa 218e97d
Bugfix and cleanup for Rfxtrx (#11600)
Danielhiversen 3afa472
Xiaomi lib upgrade (#11603)
Danielhiversen 7a50450
Upgrade yarl to 0.18.0 (#11609)
fabaff d88edb0
patch stop command (#11612)
bakedraccoon 7837b48
Use kelvin/mireds correctly for setting iglo white (#11622)
jesserockz 9b15cfa
Update Pyarlo to 0.1.2 (#11626)
arsaboo c3ff5de
Merge pull request #11589 from home-assistant/release-0-61
fabaff f86b645
Merge branch 'master' into dev
fabaff 3979387
Add Deconz support for Zigbee green power devices like Hue Tap (#11455)
Kane610 1ed0c7d
Bump dev to 0.62.0.dev0 (#11652)
fabaff fa4ffa8
Get zha switch state on HA start
8cdb1d5
Get zha binary_switch state on HA start
3d33a52
Lint fix
843cf18
File permission revert
28f0aaf
Ensure state ignores unknown data types
f9c539b
Filter to alarm attributes
3536530
Fix formatting
856b04a
Merge branch 'zha-switch-state' of github.com:SteveEasley/home-assist…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): | |
pass | ||
|
||
sensor = BinarySensor(device_class, **discovery_info) | ||
async_add_devices([sensor]) | ||
async_add_devices([sensor], update_before_add=True) | ||
|
||
|
||
class BinarySensor(zha.Entity, BinarySensorDevice): | ||
|
@@ -87,3 +87,31 @@ def cluster_command(self, aps_frame, tsn, command_id, args): | |
elif command_id == 1: | ||
_LOGGER.debug("Enroll requested") | ||
self.hass.add_job(self._ias_zone_cluster.enroll_response(0, 0)) | ||
|
||
@asyncio.coroutine | ||
def async_update(self): | ||
"""Retrieve latest state.""" | ||
_LOGGER.debug("%s async_update", self.entity_id) | ||
|
||
@asyncio.coroutine | ||
def safe_read(cluster, attributes): | ||
"""Swallow all exceptions from network read. | ||
|
||
If we throw during initialization, setup fails. Rather have an | ||
entity that exists, but is in a maybe wrong state, than no entity. | ||
""" | ||
try: | ||
result, _ = yield from cluster.read_attributes( | ||
attributes, | ||
allow_cache=False, | ||
) | ||
return result | ||
except Exception: # pylint: disable=broad-except | ||
return {} | ||
|
||
from bellows.types.basic import uint16_t | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blank line at end of file |
||
result = yield from safe_read(self._endpoint.ias_zone, ['zone_status']) | ||
state = result.get('zone_status', self._state) | ||
if isinstance(state, (int, uint16_t)): | ||
self._state = result.get('zone_status', self._state) & 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extract this method and move it to the
zha
component and import it from there. There is no need to copy this method to every platform.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be wrong here but I think
should_poll(self) -> bool:
also needs to be overridden to return false on the base ZHA entity class. With debugging on, it appears that hass is calling theasync_update
functions that were added to these classes to poll for changes behind the scenes. The zigbee devices are already configured to push changes to hass when necessary to preserve battery life. I think leaving this as is will severly affect battery life of the sensors. @balloob, does this make sense? or am I way off base?