def test_get_active_mode_hot_water_one_day_away(self) -> None: """Test get active mode for hot water with one day away.""" dhw = Dhw(hotwater=_hotwater()) system = System(dhw=dhw, quick_mode=QuickModes.ONE_DAY_AWAY) active_mode = system.get_active_mode_hot_water() self.assertEqual(QuickModes.ONE_DAY_AWAY, active_mode.current) self.assertEqual(constants.FROST_PROTECTION_TEMP, active_mode.target)
def test_get_active_mode_hot_water_system_off(self) -> None: """Test active mode hot water system off.""" dhw = Dhw(hotwater=_hotwater()) system = System(dhw=dhw, quick_mode=QuickModes.SYSTEM_OFF) active_mode = system.get_active_mode_hot_water() self.assertEqual(QuickModes.SYSTEM_OFF, active_mode.current) self.assertEqual(constants.FROST_PROTECTION_TEMP, active_mode.target)
def test_get_active_mode_hot_water(self) -> None: """Test get active mode for hot water.""" dhw = Dhw(hotwater=_hotwater()) system = System(dhw=dhw) active_mode = system.get_active_mode_hot_water() self.assertEqual(OperatingModes.AUTO, active_mode.current) self.assertEqual(SettingModes.ON, active_mode.sub) self.assertEqual(50, active_mode.target)
def test_get_active_mode_hotwater_no_timeprogram_on(self) -> None: """Test get active mode for hot water.""" dhw = Dhw(hotwater=_hotwater()) dhw.hotwater.time_program = None dhw.hotwater.operating_mode = OperatingModes.ON system = System(dhw=dhw) active_mode = system.get_active_mode_hot_water() self.assertEqual(OperatingModes.ON, active_mode.current) self.assertEqual(50, active_mode.target)
def test_get_active_mode_hotwater_empty_timeprogram(self) -> None: """Test get active mode for hot water.""" dhw = Dhw(hotwater=_hotwater()) dhw.hotwater.time_program = TimeProgram(days={}) system = System(dhw=dhw) active_mode = system.get_active_mode_hot_water() self.assertEqual(OperatingModes.AUTO, active_mode.current) self.assertEqual(SettingModes.ON, active_mode.sub) self.assertEqual(50, active_mode.target)
def test_get_active_mode_hot_water_party(self) -> None: """Test active mode hot water off.""" hotwater = _hotwater() hotwater.time_program = _time_program(SettingModes.OFF) dhw = Dhw(hotwater=hotwater) system = System(dhw=dhw, quick_mode=QuickModes.PARTY) active_mode = system.get_active_mode_hot_water() self.assertEqual(QuickModes.PARTY, active_mode.current) self.assertEqual(hotwater.target_high, active_mode.target)
def test_get_active_mode_hot_water_off(self) -> None: """Test active mode hot water off.""" hotwater = _hotwater() hotwater.time_program = _time_program(SettingModes.OFF) dhw = Dhw(hotwater=hotwater) system = System(dhw=dhw) active_mode = system.get_active_mode_hot_water() self.assertEqual(OperatingModes.AUTO, active_mode.current) self.assertEqual(SettingModes.OFF, active_mode.sub) self.assertEqual(HotWater.MIN_TARGET_TEMP, active_mode.target)
def test_get_active_mode_hot_water_holiday_mode(self) -> None: """Test get active mode for hot water with holiday mode.""" holiday = HolidayMode(True, datetime.date.today(), datetime.date.today(), 10) dhw = Dhw(hotwater=_hotwater()) system = System(holiday=holiday, dhw=dhw) active_mode = system.get_active_mode_hot_water() self.assertEqual(QuickModes.HOLIDAY, active_mode.current) self.assertEqual(constants.FROST_PROTECTION_TEMP, active_mode.target)
def test_get_active_mode_hot_water_hot_water_boost(self) -> None: """Test get active mode for hot water with hot water boost.""" temp = 55 hot_water = _hotwater() hot_water.operating_mode = OperatingModes.ON hot_water.target_high = temp dhw = Dhw(hotwater=hot_water) system = System(dhw=dhw, quick_mode=QuickModes.HOTWATER_BOOST) active_mode = system.get_active_mode_hot_water() self.assertEqual(active_mode.current, QuickModes.HOTWATER_BOOST) self.assertEqual(temp, active_mode.target)
def test_get_active_mode_hot_water_no_hotwater(self) -> None: """Test active mode without hot water.""" system = System(quick_mode=QuickModes.HOTWATER_BOOST) active_mode = system.get_active_mode_hot_water() self.assertIsNone(active_mode)