hass-core/homeassistant/components
Greg Laabs 1c8b5838cd ISY994 sensor improvements (#10805)
* Fire events for ISY994 control events

This allows hass to react directly to Insteon button presses (on switches and remotes), including presses, double-presses, and long holds

* Move change event subscription to after entity is added to hass

The event handler method requires `self.hass` to exist, which doesn't have a value until the async_added_to_hass method is called. Should eliminate a race condition.

* Overhaul binary sensors in ISY994 to be functional "out of the box"

We now smash all of the subnodes from the ISY994 in to one Hass binary_sensor, and automatically support both paradigms of state reporting that Insteon sensors can do. Sometimes a single node's state represents the sensor's state, other times two nodes are used and only "ON" events are sent from each. The logic between the two forunately do not conflict so we can support both without knowing which mode the device is in.

This also allows us to handle the heartbeat functionality that certain sensors have - we simply store the timestamp of the heartbeat as an attribute on the sensor device. It defaults to Unknown on bootup if and only if the device supports heartbeats, due to the presence of subnode 4.

* Parse the binary sensor device class from the ISY's device "type"

Now we automatically know which sensors are moisture, motion, and openings! (We also reverse the moisture sensor state, because Insteon reports ON for dry on the primary node.)

* Code review tweaks

The one material change here is that the event subscribers were moved to the `async_added_to_hass` method, as the handlers depend on things that only exist after the entity has been added.

* Handle cases where a sensor's state is unknown

When the ISY first boots up, if a battery-powered sensor has not reported in yet (due to heartbeat or a change in state), the state is unknown until it does.

* Clean up from code review

Fix coroutine await, remove unnecessary exception check, and return None when state is unknown

* Unknown value from PyISY is now -inf rather than -1

* Move heartbeat handling to a separate sensor

Now all heartbeat-compatible sensors will have a separate `binary_sensor` device that represents the battery state (on = dead)

* Add support for Unknown state, which is being added in next PyISY 

PyISY will report unknown states as the number "-inf". This is implemented in the base ISY994 component, but subcomponents that override the `state` method needed some extra logic to handle it as well.

* Change a couple try blocks to explicit None checks

* Bump PyISY to 1.1.0, now that it has been published!

* Remove -inf checking from base component

The implementation of the -inf checking was improved in another branch which has been merged in to this branch already.

* Restrict negative-node and heartbeat support to known compatible types

Not all Insteon sensors use the same subnode IDs for the same things, so we need to use different logic depending on device type. Negative node and heartbeat support is now only used for leak sensors and open/close sensors.

* Use new style string formatting

* Add binary sensor detection for pre-5.x firmware

Meant to do this originally; writing documentation revealed that this requirement was missed!
2017-12-13 20:14:56 -08:00
..
ads Add ADS component (#10142) 2017-12-05 09:44:22 +01:00
alarm_control_panel add custom bypass status to total connect (#11042) 2017-12-10 16:02:12 -05:00
alexa Fix scene description formatting. (#10785) 2017-11-24 15:52:59 -08:00
automation Bugfix trigger state with multible entities (#10857) 2017-11-30 21:03:52 +01:00
binary_sensor ISY994 sensor improvements (#10805) 2017-12-13 20:14:56 -08:00
calendar Add a caldav calendar component (#10842) 2017-12-10 17:44:28 +01:00
camera Add support for Canary component and platforms (#10306) 2017-12-08 10:40:45 +01:00
climate Added Vera scenes (#10424) 2017-12-07 07:47:19 +01:00
cloud Update Warrant (#11101) 2017-12-12 21:12:41 -08:00
config Fixed typo in automation.py (#11116) 2017-12-13 10:17:12 +01:00
counter Move counter component (#10332) 2017-11-05 13:51:52 +01:00
cover ISY994 sensor improvements (#10805) 2017-12-13 20:14:56 -08:00
device_tracker Add GPS coords to meraki (#10998) 2017-12-10 09:47:14 -08:00
emulated_hue Refactored to new global json saving and loading (#10677) 2017-11-19 19:47:55 -08:00
fan python-miio version bumped for improved device support. (#10720) 2017-11-21 09:23:39 +01:00
frontend In dev mode expose only relevant sources (#11026) 2017-12-08 17:25:16 -08:00
google_assistant add support for multiple execution per execute request (#10844) 2017-11-28 23:16:29 -08:00
group Update services.yaml files (#10229) 2017-10-30 21:39:12 +01:00
http Add an option to serve ES6 JS to clients (#10474) 2017-11-10 23:02:06 -08:00
image_processing Update services.yaml files (#10229) 2017-10-30 21:39:12 +01:00
light Report availability for TP-Link smart bulbs (#10976) 2017-12-12 17:18:46 +01:00
lock ISY994 sensor improvements (#10805) 2017-12-13 20:14:56 -08:00
mailbox Use translated panel names on frontend (#10197) 2017-10-31 20:22:04 -07:00
media_player Add media position properties (#10076) 2017-12-13 10:58:49 +01:00
mqtt Make MQTT reconnection logic more resilient and fix race condition (#10133) 2017-11-17 10:29:23 -08:00
notify Make notify.html5 depend on config (#11052) 2017-12-09 13:14:16 -08:00
persistent_notification Update services.yaml files (#10229) 2017-10-30 21:39:12 +01:00
recorder Fix recorder stop on SQLite vacuuming error (#10405) 2017-11-08 14:43:15 +01:00
remember_the_milk integration with Remember The Milk. (#9803) 2017-10-31 20:33:47 -07:00
remote Properly initialize Harmony remote (#10665) 2017-11-19 05:20:31 +01:00
scene Added Vera scenes (#10424) 2017-12-07 07:47:19 +01:00
sensor ISY994 sensor improvements (#10805) 2017-12-13 20:14:56 -08:00
switch ISY994 sensor improvements (#10805) 2017-12-13 20:14:56 -08:00
system_log system_log improvements (#10709) 2017-11-25 16:22:41 +02:00
telegram_bot telegram_bot: Support for sending videos (#10470) 2017-11-12 00:13:35 +01:00
timer Move counter component (#10332) 2017-11-05 13:51:52 +01:00
tts Microsoft Text-to-speech: Fixing missing en-gb support bug (#10429) 2017-12-01 12:38:20 +01:00
vacuum Xiaomi Vacuum: remove deprecated calls (#10839) 2017-12-01 12:28:59 +01:00
weather Fix issues from review of ecobee weather component (#10903) 2017-12-02 22:44:55 +01:00
wink Allow chime to work for wink siren/chime (#10961) 2017-12-05 22:07:59 -08:00
zha zha: Update to bellows 0.4.0 (#9890) 2017-10-15 21:41:16 -07:00
zwave Bugfix #10902 (#10904) 2017-12-03 00:15:57 +01:00
__init__.py Add service descriptions (#9806) 2017-10-12 21:59:07 -07:00
abode.py Bump to 0.12.2 to fix urllib3 dependency (#10420) 2017-11-07 01:39:13 +01:00
alarmdecoder.py Upgrade the alarmdecoder dependency library from 0.12.1 to 0.12.3. (#8542) 2017-07-19 12:21:39 +02:00
alert.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
amcrest.py Protect sensitive information for Amcrest cameras (#10569) 2017-11-23 16:38:53 -08:00
android_ip_webcam.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
apcupsd.py Update apcaccess to 0.0.13. Add "Percent Load Capacity" to INFERRED_UNITS. (#8277) 2017-07-02 11:24:07 +02:00
api.py Json api fix (#10017) 2017-10-22 00:44:46 -07:00
apple_tv.py Bump pyatv to 0.3.9 (#11104) 2017-12-12 16:52:39 +01:00
arduino.py Supress trackback and upgrade PyMata to 2.14 (#7176) 2017-04-19 12:48:15 +02:00
arlo.py Arlo - Fixes for updated library (#9892) 2017-11-15 23:33:50 +01:00
asterisk_mbox.py Add Initial Mailbox panel and sensor (#8233) 2017-08-06 11:19:47 -07:00
axis.py Refactored to new global json saving and loading (#10677) 2017-11-19 19:47:55 -08:00
bbb_gpio.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
blink.py Blink version bump (#7571) 2017-05-12 20:30:07 -07:00
bloomsky.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
browser.py
canary.py Add support for Canary component and platforms (#10306) 2017-12-08 10:40:45 +01:00
comfoconnect.py Update docstrings (#8244) 2017-06-29 11:44:35 +02:00
configurator.py Convert configurator to use markdown (#10668) 2017-11-20 14:11:55 +01:00
conversation.py Fix conversation (#10686) 2017-11-20 20:26:36 -08:00
datadog.py Add datadog component (#7158) 2017-05-06 00:34:40 +02:00
demo.py Rename input_slider to input_number and add numeric text box option (#9494) 2017-10-03 21:34:13 +02:00
device_sun_light_trigger.py Refactor sun component for correctness (#7295) 2017-05-09 00:03:34 -07:00
dialogflow.py Move constants to setup.py (#10312) 2017-11-03 07:43:30 -07:00
digital_ocean.py Use 'hass.data' instead of global (#8245) 2017-06-30 08:46:03 +02:00
discovery.py Refactor hue to split bridge support from light platform (#10691) 2017-12-10 10:15:01 -08:00
dominos.py Reload closest store on api menu request (#10962) 2017-12-05 10:47:48 +01:00
doorbird.py Use new DoorBirdPy (v0.1.0) (#10734) 2017-11-22 11:40:15 +01:00
downloader.py Adjust logging in downloader component (#10622) 2017-11-16 22:05:08 -08:00
duckdns.py Add link to docs and update ordering (#10062) 2017-10-23 12:18:23 +02:00
dweet.py Upgrade dweepy to 0.3.0 (#7550) 2017-05-11 22:48:03 +02:00
dyson.py Add support to Dyson 360 Eye robot vacuum using new vacuum platform (#8852) 2017-08-06 13:08:46 +02:00
ecobee.py Update ecobee version to fix stack-trace issue (#10894) 2017-12-02 07:56:35 +02:00
eight_sleep.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
emoncms_history.py Don't use len(SEQUENCE) as condition value (#7249) 2017-04-23 20:41:09 -07:00
enocean.py Fix for API change of new enocean package (#10328) 2017-11-04 12:58:02 +01:00
envisalink.py Update to pyenvisalink 2.2, and remove range validation on zonedump i… (#8981) 2017-08-16 12:08:15 +02:00
feedreader.py Don't use len(SEQUENCE) as condition value (#7249) 2017-04-23 20:41:09 -07:00
ffmpeg.py Update ffmpeg.py 2017-10-19 10:36:09 +02:00
foursquare.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
gc100.py Updated gc100 package requirement to 1.0.3a (#10484) 2017-11-09 17:54:45 +01:00
google.py Changed yaml.load into yaml.safe_load (#9841) 2017-10-12 22:05:33 -07:00
google_domains.py Fix lint google-domains (#10135) 2017-10-25 15:43:02 +02:00
graphite.py Use const (#9127) 2017-08-25 13:30:00 +02:00
hassio.py Add panel build type (#10589) 2017-11-14 22:39:06 -08:00
hdmi_cec.py Ensure display-name does not exceed 12 characters for CecAdapter. (#9268) 2017-09-05 18:11:02 +03:00
history.py Core POC support for polymer i18n (#6344) 2017-10-26 21:46:21 -07:00
history_graph.py Add history_graph component (#9472) 2017-09-23 10:01:48 -07:00
hive.py New Hive Component / Platforms (#9804) 2017-11-23 13:10:23 +01:00
homematic.py Upgrade HomeMatic, add devices (#10845) 2017-11-28 23:16:47 -08:00
hue.py Skip HASS emulated Hue bridges from detection. (#11128) 2017-12-13 20:00:30 -08:00
ifttt.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
influxdb.py InfluxDB send retry after IOError (#10263) 2017-11-23 16:58:18 -08:00
input_boolean.py added services.yaml integration for input_boolean (#9519) 2017-09-21 16:58:12 +02:00
input_datetime.py Correct input_datetime initial value parsing (#10417) 2017-11-15 23:16:22 -08:00
input_number.py Move constant to 'const.py' and use already definied ones (#10204) 2017-10-29 12:32:02 +01:00
input_select.py Add bind_hass to components (#8502) 2017-07-16 10:14:46 -07:00
input_text.py input_text - Added service doc (#10238) 2017-10-31 14:51:12 +01:00
insteon_local.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
insteon_plm.py insteon_plm: fix typo in attributes (#9284) 2017-09-03 15:42:05 -04:00
intent_script.py Add Intent component (#8434) 2017-07-21 21:38:53 -07:00
introduction.py Change introduction card to use persistent notification (#10265) 2017-11-01 09:10:36 +01:00
ios.py fix ios component config generation (#10923) 2017-12-03 14:59:22 -08:00
isy994.py ISY994 sensor improvements (#10805) 2017-12-13 20:14:56 -08:00
joaoapps_join.py Update join (#7443) 2017-05-04 13:14:14 -07:00
juicenet.py Add juicenet platform (#7668) 2017-06-05 08:39:31 -07:00
keyboard.py
keyboard_remote.py Allow using more than one keyboard remote (#11061) 2017-12-13 20:07:23 -08:00
kira.py Add Kira component to sensor and remote platforms (#7479) 2017-05-12 21:12:47 -07:00
knx.py Revert "KNX: Added config option for broadcasting current time to KNX bus. (#10654)" (#10874) 2017-11-30 15:52:57 +01:00
lametric.py Fix lametric sound (#10562) 2017-11-14 10:40:44 +01:00
linode.py Linode (#9936) 2017-10-27 16:19:47 +02:00
lirc.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
litejet.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
logbook.py Core POC support for polymer i18n (#6344) 2017-10-26 21:46:21 -07:00
logentries.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
logger.py Replace executor with async_add_job (#7658) 2017-05-26 08:28:07 -07:00
lutron.py Fix typo (sending USERNAME instead of PASSWORD) introduced in #7963 (#8433) 2017-07-10 20:52:37 -07:00
lutron_caseta.py upgrade to new pylutron_caseta with TLS (#10286) 2017-11-10 12:17:25 +01:00
mailgun.py Update mailgun (#7984) 2017-06-11 22:19:10 -07:00
map.py Core POC support for polymer i18n (#6344) 2017-10-26 21:46:21 -07:00
maxcube.py Remove superfluous comments and update ordering (#7227) 2017-04-22 21:13:04 +02:00
media_extractor.py Upgrade youtube_dl to 2017.12.10 (#11080) 2017-12-11 13:53:01 +01:00
microsoft_face.py Replace executor with async_add_job (#7658) 2017-05-26 08:28:07 -07:00
mochad.py Serialize mochad requests (#11029) 2017-12-08 09:18:52 -08:00
modbus.py Communication timeout support in modbus hub. (#9780) 2017-10-09 23:51:18 +02:00
mqtt_eventstream.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
mqtt_statestream.py Implement entity and domain exclude/include for Alexa (#10647) 2017-11-17 21:10:24 -08:00
mycroft.py Upgrade mycroftapi to 2.0 (#9309) 2017-09-05 07:05:31 -04:00
mysensors.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
namecheapdns.py Make host optional (#10063) 2017-10-23 15:24:04 +02:00
neato.py Pybotvac multi (#10843) 2017-12-02 15:44:24 +01:00
nest.py Add support for Automatic OAuth2 authentication (#8962) 2017-08-13 22:37:50 -07:00
netatmo.py Netatmo httperror403 fix (#10659) 2017-11-18 14:36:01 -08:00
no_ip.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
nuimo_controller.py Clean up requirements (#7391) 2017-05-02 09:15:02 -07:00
octoprint.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
panel_custom.py Fix panel_custom (#10303) 2017-11-03 21:18:32 -07:00
panel_iframe.py Consolidate frontend (#9915) 2017-10-24 19:36:27 -07:00
pilight.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
plant.py Update plant for dealing with float values (#10246) 2017-11-02 09:17:26 +01:00
prometheus.py Export climate status and target temperature to Prometheus (#10919) 2017-12-04 13:39:26 +01:00
proximity.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
python_script.py Added sorted() to python_script (#10621) 2017-11-16 22:06:02 -08:00
qwikswitch.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
raincloud.py Raincloudy version bump (#10225) 2017-10-30 08:36:38 +01:00
raspihats.py raspihats: unmet dependency fix (#9638) 2017-10-01 23:05:24 -07:00
rest_command.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
rflink.py Cover component for RFlink (#9432) 2017-09-29 00:49:03 +02:00
rfxtrx.py Rfxtrx binary sensor rewrite (#10152) 2017-10-27 10:01:46 +02:00
ring.py Load Ring camera only with Ring Protect plan activated (#10739) 2017-11-25 12:15:12 +01:00
rpi_gpio.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
rpi_pfio.py Support for the PiFace Digital I/O module (#7494) 2017-05-09 22:36:33 -07:00
rss_feed_template.py Remove ordered_dict validator (#7375) 2017-04-30 10:55:03 -07:00
satel_integra.py Added satel_integra alarm panel and binary sensor platform (#9336) 2017-09-18 17:42:31 +02:00
script.py Add scripts editor backend (#8993) 2017-08-15 22:09:10 -07:00
scsgate.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
services.yaml Add ADS component (#10142) 2017-12-05 09:44:22 +01:00
shell_command.py Make shell_command async (#10741) 2017-11-23 17:28:31 -08:00
shiftr.py Upgrade paho-mqtt to 1.3.1 (#9874) 2017-10-15 10:12:43 -07:00
shopping_list.py Shopping list: add item HTTP API (#10674) 2017-11-20 21:44:22 -08:00
skybell.py Skybell (#9681) 2017-10-08 20:14:39 +02:00
sleepiq.py Fix a bunch of typos (#9545) 2017-09-23 17:15:46 +02:00
snips.py Update snips to listen on new mqtt topic and utilize rawValue (#11020) 2017-12-08 09:16:08 -08:00
spc.py Add attribute to show who last un/set alarm (SPC) (#9906) 2017-11-11 12:36:03 -08:00
splunk.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
statsd.py Adding support for mapping keys to value in statsd (#8665) 2017-07-27 08:58:34 +02:00
sun.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
tado.py pytado moved to pypi (#8298) 2017-07-02 12:54:59 -07:00
tahoma.py Tahoma platform for Somfy Covers and Sensors (#10652) 2017-11-19 21:35:13 +01:00
tellduslive.py Upgrade tellduslive library version (closes https://github.com/home-assistant/home-assistant/issues/10922) (#10950) 2017-12-04 17:26:07 +01:00
tellstick.py Update tellcore-net to 0.4 (#11087) 2017-12-11 18:32:48 +01:00
tesla.py Fixes #10030. Extented Network Exceptions handling. (#10116) 2017-10-24 19:15:25 +02:00
thethingsnetwork.py Support for The Things Network (#9627) 2017-10-05 09:12:02 -07:00
thingspeak.py Upgrade thingspeak to 0.4.1 and use the correct API key (#5906) 2017-02-13 11:25:28 +01:00
toon.py Fix PEP8 and PEP257 issues (#10108) 2017-10-24 18:36:08 +02:00
tradfri.py Update pytradfri to 4.1.0 (#10521) 2017-11-22 09:37:20 +00:00
twilio.py Update docstrings (#6795) 2017-03-26 15:50:40 +02:00
updater.py Upgrade distro to 1.1.0 (#10850) 2017-11-30 15:58:50 +01:00
upnp.py Allow specifying multiple ports for UPNP component (#9560) 2017-09-24 13:08:58 -07:00
usps.py fix usps? (#9557) 2017-09-24 08:28:11 +02:00
velbus.py Velbus (#8076) 2017-07-26 14:03:29 +02:00
velux.py Fixed link to documentation (#8424) 2017-07-10 12:11:16 +02:00
vera.py Added Vera scenes (#10424) 2017-12-07 07:47:19 +01:00
verisure.py Verisure: Added option to set installation giid (#10504) 2017-11-14 15:53:26 +01:00
volvooncall.py Volvo on call: Optional use of Scandinavian miles. Also add average fuel consumption property (#11051) 2017-12-10 13:57:44 -08:00
vultr.py Add platform and sensors for Vultr VPS (#9928) 2017-11-05 14:10:14 +01:00
wake_on_lan.py New service send_magic_packet with new component wake_on_lan (#8397) 2017-07-10 18:37:51 -07:00
weblink.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
websocket_api.py Add an option to serve ES6 JS to clients (#10474) 2017-11-10 23:02:06 -08:00
wemo.py Bump pywemo, handle more ports. 2017-09-03 11:31:55 +01:00
xiaomi_aqara.py don't ignore voltage data if sensor data changed (#10925) 2017-12-04 17:26:41 +01:00
zabbix.py Update docstring (quotes, links, content) (#5602) 2017-01-28 16:02:19 +01:00
zeroconf.py Upgrade zeroconf to 0.19.1 (#8043) 2017-06-15 21:25:19 +02:00
zigbee.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
zone.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
zoneminder.py zoneminder: fix incorrect use of logging.exception. (#7675) 2017-05-21 11:11:33 +02:00