• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

home-assistant / home-assistant / 28726
94%

Build:
DEFAULT BRANCH: dev
Ran 29 Aug 2017 10:06PM UTC
Jobs 5
Files 292
Run time 84min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
28726

push

travis-ci

pvizeli
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

88 of 88 new or added lines in 1 file covered. (100.0%)

25172 of 26855 relevant lines covered (93.73%)

2.81 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
homeassistant/components/binary_sensor/bayesian.py
Jobs
ID Job ID Ran Files Coverage
1 28726.1 (TOXENV=lint) 29 Aug 2017 10:14PM UTC 0
Travis Job 28726.1
2 28726.2 (TOXENV=py34) 29 Aug 2017 10:06PM UTC 0
93.72
Travis Job 28726.2
3 28726.3 (TOXENV=py35) 29 Aug 2017 10:06PM UTC 0
93.71
Travis Job 28726.3
4 28726.4 (TOXENV=py36) 29 Aug 2017 10:18PM UTC 0
93.71
Travis Job 28726.4
5 28726.5 (TOXENV=requirements) 29 Aug 2017 10:07PM UTC 0
Travis Job 28726.5
Source Files on build 28726
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #28726
  • 7de73e9e on github
  • Prev Build on dev (#28720)
  • Next Build on dev (#28727)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc