Refactor bayesian observations using dataclass (#79590)
* refactor * remove some changes * remove typehint * improve codestyle * move docstring to comment * < 88 chars * avoid short var names * more readable * fix rename * Update homeassistant/components/bayesian/helpers.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Update homeassistant/components/bayesian/binary_sensor.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Update homeassistant/components/bayesian/binary_sensor.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * no intermediate * comment why set before list Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
56dd0a6867
commit
dd1463da28
4 changed files with 195 additions and 105 deletions
17
homeassistant/components/bayesian/const.py
Normal file
17
homeassistant/components/bayesian/const.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
"""Consts for using in modules."""
|
||||
|
||||
ATTR_OBSERVATIONS = "observations"
|
||||
ATTR_OCCURRED_OBSERVATION_ENTITIES = "occurred_observation_entities"
|
||||
ATTR_PROBABILITY = "probability"
|
||||
ATTR_PROBABILITY_THRESHOLD = "probability_threshold"
|
||||
|
||||
CONF_OBSERVATIONS = "observations"
|
||||
CONF_PRIOR = "prior"
|
||||
CONF_TEMPLATE = "template"
|
||||
CONF_PROBABILITY_THRESHOLD = "probability_threshold"
|
||||
CONF_P_GIVEN_F = "prob_given_false"
|
||||
CONF_P_GIVEN_T = "prob_given_true"
|
||||
CONF_TO_STATE = "to_state"
|
||||
|
||||
DEFAULT_NAME = "Bayesian Binary Sensor"
|
||||
DEFAULT_PROBABILITY_THRESHOLD = 0.5
|
Loading…
Add table
Add a link
Reference in a new issue