core/homeassistant/components/binary_sensor
Jeff McGehee 7de73e9ef7 Bayesian Binary Sensor (#8810)
* Bayesian Binary Sensor

Why:

* It would be beneficial to leverage various sensor outputs in a
Bayesian manner in order to sense more complex events.

This change addresses the need by:

* `BayesianBinarySensor` class in
`./homeassistant/components/binary_sensor/bayesian.py`
* Tests in `./tests/components/binary_sensor/test_bayesian.py`

Caveats:
This is my first time in this code-base. I did try to follow conventions
that I was able to find, but I'm sure there will be some issues to
straighten out.

* minor cleanup

* Address reviewer's comments

This change addresses the need by:

* Removing `CONF_SENSOR_CLASS` and its usage in `get_deprecated`.
* Make probability update function a static method, and use single `_`
to match project conventions.

* Address linter failures

* fix `device_class` declaration

* Address Comments

Why:
* Not validating config schema enough.
* Not following common practices for async initialization.
* Naive implementation of Bayes' rule.

This change addresses the need by:
* Improving config validation for observations.
* Moving initialization logic into `async_added_to_hass`.
* Re-configuring Bayesian updates to allow true P|Q usage.

* address linting issues

* Improve DRYness by adding `_update_current_obs` method

* update doc strings and ensure functions are set up properly for async

* Make only 1 state change handle

* fix style

* fix style part 2

* fix lint
2017-08-29 23:53:41 +02:00
..
__init__.py Remove deprecated substitute interfaces (#8701) 2017-07-29 19:18:06 -04:00
abode.py Abode push events and lock, cover, and switch components (#9095) 2017-08-29 17:34:19 +02:00
alarmdecoder.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
android_ip_webcam.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
apcupsd.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
arest.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
aurora.py Add aurora sensor (#6003) 2017-02-17 09:13:52 +01:00
axis.py Axis component (#7381) 2017-05-12 08:51:54 -07:00
bayesian.py Bayesian Binary Sensor (#8810) 2017-08-29 23:53:41 +02:00
bbb_gpio.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
blink.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
bloomsky.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
command_line.py Added possibilities to use template in the command_line sensor (#8505) 2017-08-10 18:52:52 +02:00
concord232.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
demo.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
digital_ocean.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
ecobee.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
eight_sleep.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
enocean.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
envisalink.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
ffmpeg_motion.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
ffmpeg_noise.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
flic.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
hikvision.py Update pyHik to catch XML errors (#8384) 2017-07-06 21:23:47 -07:00
homematic.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
insteon_plm.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
iss.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
isy994.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
knx.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
maxcube.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
modbus.py Modbus fixes to work with pymodbus 1.3.1 (#8365) 2017-07-06 22:30:23 -07:00
mqtt.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
mysensors.py Refactor mysensors callback and add validation (#9069) 2017-08-25 08:58:05 -07:00
mystrom.py Fix more deprecation warnings (#7778) 2017-05-26 13:12:17 -07:00
nest.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
netatmo.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
nx584.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
octoprint.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
pilight.py Allow Pilight Binary Sensor to control reset_delay_sec through configuration (#8358) 2017-07-06 21:09:31 +02:00
ping.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
raspihats.py Add raspihats binary sensor (#7508) 2017-05-12 09:20:48 -07:00
rest.py Do not call update() in constructor (#8881) 2017-08-08 06:52:27 +02:00
rfxtrx.py Add is_lighting4 to RfxtrxBinarySensor (#8563) 2017-07-20 11:12:42 +02:00
ring.py Introduced Ring binary sensors and refactored Ring component (#6520) 2017-03-31 08:53:56 -07: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
sleepiq.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
spc.py Add support for Vanderbilt SPC alarm panels and attached sensors (#7663) 2017-06-04 23:53:25 -07:00
tapsaff.py Added a Taps Aff binary sensor (#7880) 2017-06-04 13:35:19 +02:00
tcp.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
template.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
threshold.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
trend.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
velbus.py Velbus (#8076) 2017-07-26 14:03:29 +02:00
vera.py Append vera device id to entity id - but not name. (#6523) 2017-03-11 10:06:46 -08:00
verisure.py verisure component names (#8251) 2017-06-30 08:53:14 +02:00
volvooncall.py Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
wemo.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
wink.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
workday.py Workday sensor offset (#8824) 2017-08-21 13:24:30 +02:00
xiaomi.py Xiaomi gateway: Device support for the Aqara Water Leak Sensor (sensor_wleak.aq1) (#9172) 2017-08-27 21:06:11 +02:00
zha.py zha: Handle both input and output clusters (#8410) 2017-07-10 21:16:44 -07:00
zigbee.py Update docstrings (#7361) 2017-04-29 22:04:49 -07:00
zwave.py Fix off_delay for zwave trigger sensors (#8864) 2017-08-06 18:31:32 +03:00