Reset neighbours' cross-ventilation when a window's polarity flips

A flipped contact sensor reverses what every term saw as open, including the
other zones' cross-ventilation term, whose fingerprint covered only the
window's sensor and opening factor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
buzeraandClaude Opus 5.5 committed 2026-10-27 03:53:39 +02:00
1 parent 4911b32c5e
commit 8eef04c385
2 files changed
+8 -2

No files matched your search

+6
View File
@@ -72,6 +72,12 @@ class FingerprintTests(unittest.TestCase):
self.assertEqual(diff['bed'], ['recovery', 'vent_cross', 'vent_gust', 'vent_natural', 'vent_wind',
'vent_wind_dir'])
self.assertEqual(diff['living'], ['vent_cross']) # sees the bedroom's windows
# A flipped polarity reverses what every term saw as open, the neighbour's too.
flipped = [{'key': 'w1', 'sensor': 'binary_sensor.w1', 'zone': 'bed', 'azimuth': 345, 'inverted': True},
{'key': 'w2', 'sensor': 'binary_sensor.w2', 'zone': 'living', 'azimuth': 345}]
diff = differing(self.base, setup(windows=flipped)[0])
self.assertIn('vent_natural', diff['bed'])
self.assertEqual(diff['living'], ['vent_cross'])
self.assertEqual(differing(self.base, setup(recovery=40)[0]), {'living': ['recovery'], 'bed': ['recovery']})
def test_baseline_prints_and_change_detection(self):