hass-core/tests
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
..
components Bayesian Binary Sensor (#8810) 2017-08-29 23:53:41 +02:00
fixtures Adds London_air component (#9020) 2017-08-19 11:05:16 +02:00
helpers Allow getting number of available states in template (#9158) 2017-08-27 18:33:25 +02:00
mock Tests for zwave setup features (#7570) 2017-05-12 20:27:44 -07:00
resources Revised package util tests 2016-01-30 14:08:32 -05:00
scripts Group service / dynamic handling (#7971) 2017-06-16 00:52:28 +02:00
test_util Add cloud auth support (#9208) 2017-08-29 13:40:08 -07:00
testing_config Add Kira component to sensor and remote platforms (#7479) 2017-05-12 21:12:47 -07:00
util Warn instead of raise on duplicate YAML key (#8834) 2017-08-06 10:47:19 -07:00
__init__.py async HTTP component (#3914) 2016-10-23 23:48:01 -07:00
common.py Add cloud auth support (#9208) 2017-08-29 13:40:08 -07:00
conftest.py Abort tests when instances leaked (#7623) 2017-05-18 00:19:40 +02:00
test_bootstrap.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_config.py Add cloud auth support (#9208) 2017-08-29 13:40:08 -07:00
test_core.py Is_allowed_path raise for None path (#8953) 2017-08-15 15:41:37 +02:00
test_loader.py Expose all components on hass [Concept] (#8490) 2017-07-16 09:23:06 -07:00
test_main.py Migrate core from threads to async awesomeness (#3248) 2016-09-12 19:16:14 -07:00
test_remote.py Remove deprecated remote classes (#7011) 2017-04-10 09:04:19 -07:00
test_setup.py Fix check for running inside venv (#8481) 2017-07-15 07:25:02 -07:00