def test_get_active_mode_room_system_off(self) -> None: """Test active mode room when system off.""" room = _room() system = System(rooms=[room], quick_mode=QuickModes.SYSTEM_OFF) active_mode = system.get_active_mode_room(room) self.assertEqual(QuickModes.SYSTEM_OFF, active_mode.current) self.assertEqual(Room.MIN_TARGET_TEMP, active_mode.target)
def test_get_active_mode_off(self) -> None: """Test active mode off.""" room = _room() room.operating_mode = OperatingModes.OFF active_mode = room.active_mode self.assertEqual(OperatingModes.OFF, active_mode.current) self.assertEqual(Room.MIN_TARGET_TEMP, active_mode.target) self.assertIsNone(active_mode.sub)
def test_get_active_mode_manual(self) -> None: """Test active mode manual.""" room = _room() room.operating_mode = OperatingModes.MANUAL room.target_high = 5 active_mode = room.active_mode self.assertEqual(OperatingModes.MANUAL, active_mode.current) self.assertEqual(5, active_mode.target) self.assertIsNone(active_mode.sub)
def test_get_active_mode_room_quick_veto(self) -> None: """Test mode room with quick veto.""" room = _room() quick_veto = QuickVeto(duration=0, target=22) room.quick_veto = quick_veto system = System(rooms=[room]) active_mode = system.get_active_mode_room(room) self.assertEqual(OperatingModes.QUICK_VETO, active_mode.current) self.assertEqual(quick_veto.target, active_mode.target)
def test_get_active_mode_room(self) -> None: """Test active mode room.""" room = _room() system = System(rooms=[room]) active_mode = system.get_active_mode_room(room) self.assertEqual(OperatingModes.AUTO, active_mode.current) self.assertIsNone(active_mode.sub) self.assertEqual(20, active_mode.target)
def test_get_active_mode_room_holiday_mode(self) -> None: """Test active mode room with holiday mode.""" holiday = HolidayMode(True, datetime.date.today(), datetime.date.today(), 10) room = _room() system = System(rooms=[room], holiday=holiday) active_mode = system.get_active_mode_room(room) self.assertEqual(QuickModes.HOLIDAY, active_mode.current) self.assertEqual(holiday.target, active_mode.target)