cantabile_edge, cantabile_modbus, cantabile_eebus 0.1.901: full source

This commit is contained in:
Setti Solutions S.R.L committed 2026-11-05 13:14:49 +02:00
1 parent d48b9aff87
commit e2c7085d2c
76 files changed
+5380 -330

No files matched your search

+21
View File
@@ -248,6 +248,27 @@ def test_winter_opens_in_the_sun_closes_at_night_never_in_quiet_hours():
assert moves(shades.schedule(shade(180), state(start, location={}), {}), start) == []
def test_unpriced_steps_are_no_dear_hours():
# the tariff's prices end before the horizon (None after: bundles.prices), or there is none at all
# (2026-11-05: every plan of a flat with a shade failed summing them)
start = ts(2026, 7, 15)
cool = {"temp_c": 21.0, "setpoint_c": 24.0}
dear = [30.0] * 64 + [60.0] * 16 + [None] * 16
m = moves(shades.schedule(shade(270), state(start, t_out=20.0, prices=dear), cool), start)
assert m and m[0][2] == "sun on the west facade: before the dear hours"
# no prices: no dear hours (no stand-in price); the warm room still shaded
assert moves(shades.schedule(shade(270), state(start, t_out=20.0, prices=[None] * 96), cool), start) == []
m = moves(shades.schedule(shade(270), state(start, prices=[None] * 96), {"temp_c": 26.0, "setpoint_c": 24.0}),
start)
assert m[0][2] == "sun on the west facade"
# the winter's rules use no price: the same moves with the tail unpriced
jan = ts(2026, 1, 15)
full = shades.schedule(shade(180, pos=0), state(jan, t_out=2.0), {"season": "heating"})
part = shades.schedule(shade(180, pos=0), state(jan, t_out=2.0, prices=[30.0] * 90 + [None] * 6),
{"season": "heating"})
assert part["set"] == full["set"]
def test_minimum_interval_between_moves():
start = ts(2026, 7, 15)
flip = [k % 2 for k in range(96)] # occupancy changing every quarter hour