hass-core/tests/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 Fix PEP257 issues 2016-03-09 10:25:50 +01:00
test_aurora.py assertEquals is deprecated (#7777) 2017-05-25 22:21:22 -07:00
test_bayesian.py Bayesian Binary Sensor (#8810) 2017-08-29 23:53:41 +02:00
test_binary_sensor.py binary_sensor sensor_class to entity device_class (#5860) 2017-02-10 20:46:15 -08:00
test_command_line.py Added possibilities to use template in the command_line sensor (#8505) 2017-08-10 18:52:52 +02:00
test_ffmpeg.py Fix automations listening to HOMEASSISTANT_START (#6936) 2017-04-05 23:23:02 -07:00
test_mqtt.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_nx584.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_ring.py Clean artifacts after running Ring tests. (#6944) 2017-04-05 11:26:56 +02:00
test_sleepiq.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_spc.py Add support for Vanderbilt SPC alarm panels and attached sensors (#7663) 2017-06-04 23:53:25 -07:00
test_tcp.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_template.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_threshold.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_trend.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_workday.py Workday sensor offset (#8824) 2017-08-21 13:24:30 +02:00
test_zwave.py Fix off_delay for zwave trigger sensors (#8864) 2017-08-06 18:31:32 +03:00