Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
    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)