mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add Bayesian type for binary_sensor_map component (#4640)
* initial support for Bayesian type * Cast bool state of binary_sensor to uint64_t * Rename channels to observations with Bayesian * Improve/standardize comments for all types * Use black to correct sensor.py formatting * Add SUM and BAYESIAN binary sensor map tests * Remove unused variable * Update esphome/components/binary_sensor_map/binary_sensor_map.cpp Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --------- Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
		| @@ -368,6 +368,32 @@ sensor: | ||||
|       - binary_sensor: bin3 | ||||
|         value: 100.0 | ||||
|  | ||||
|   - platform: binary_sensor_map | ||||
|     name: Binary Sensor Map | ||||
|     type: sum | ||||
|     channels: | ||||
|       - binary_sensor: bin1 | ||||
|         value: 10.0 | ||||
|       - binary_sensor: bin2 | ||||
|         value: 15.0 | ||||
|       - binary_sensor: bin3 | ||||
|         value: 100.0 | ||||
|  | ||||
|   - platform: binary_sensor_map | ||||
|     name: Binary Sensor Map | ||||
|     type: bayesian | ||||
|     prior: 0.4 | ||||
|     observations: | ||||
|       - binary_sensor: bin1 | ||||
|         prob_given_true: 0.9 | ||||
|         prob_given_false: 0.4 | ||||
|       - binary_sensor: bin2 | ||||
|         prob_given_true: 0.7 | ||||
|         prob_given_false: 0.05 | ||||
|       - binary_sensor: bin3 | ||||
|         prob_given_true: 0.8 | ||||
|         prob_given_false: 0.2 | ||||
|  | ||||
|   - platform: bl0939 | ||||
|     uart_id: uart_8 | ||||
|     voltage: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user