mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Round off probability to 2 decimals. (#9365)
* Round off probablity to 2 decimals. * Update tests * remove debug print
This commit is contained in:
committed by
Pascal Vizeli
parent
cc1979691e
commit
c7ecebfd07
@@ -73,7 +73,7 @@ class TestBayesianBinarySensor(unittest.TestCase):
|
||||
'prob_false': 0.1,
|
||||
'prob_true': 0.9
|
||||
}], state.attributes.get('observations'))
|
||||
self.assertAlmostEqual(0.7714285714285715,
|
||||
self.assertAlmostEqual(0.77,
|
||||
state.attributes.get('probability'))
|
||||
|
||||
assert state.state == 'on'
|
||||
@@ -141,7 +141,7 @@ class TestBayesianBinarySensor(unittest.TestCase):
|
||||
'prob_true': 0.8,
|
||||
'prob_false': 0.4
|
||||
}], state.attributes.get('observations'))
|
||||
self.assertAlmostEqual(0.33333333, state.attributes.get('probability'))
|
||||
self.assertAlmostEqual(0.33, state.attributes.get('probability'))
|
||||
|
||||
assert state.state == 'on'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user