mirror of
				https://github.com/home-assistant/core.git
				synced 2025-11-04 08:29:37 +00:00 
			
		
		
		
	Add the ability to reload bayesian platforms from yaml (#39771)
This commit is contained in:
		@@ -25,8 +25,11 @@ from homeassistant.helpers.event import (
 | 
			
		||||
    async_track_state_change_event,
 | 
			
		||||
    async_track_template_result,
 | 
			
		||||
)
 | 
			
		||||
from homeassistant.helpers.reload import async_setup_reload_service
 | 
			
		||||
from homeassistant.helpers.template import result_as_boolean
 | 
			
		||||
 | 
			
		||||
from . import DOMAIN, PLATFORMS
 | 
			
		||||
 | 
			
		||||
ATTR_OBSERVATIONS = "observations"
 | 
			
		||||
ATTR_OCCURRED_OBSERVATION_ENTITIES = "occurred_observation_entities"
 | 
			
		||||
ATTR_PROBABILITY = "probability"
 | 
			
		||||
@@ -106,6 +109,8 @@ def update_probability(prior, prob_given_true, prob_given_false):
 | 
			
		||||
 | 
			
		||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
 | 
			
		||||
    """Set up the Bayesian Binary sensor."""
 | 
			
		||||
    await async_setup_reload_service(hass, DOMAIN, PLATFORMS)
 | 
			
		||||
 | 
			
		||||
    name = config[CONF_NAME]
 | 
			
		||||
    observations = config[CONF_OBSERVATIONS]
 | 
			
		||||
    prior = config[CONF_PRIOR]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user