Exemplo n.º 1
0
    def test_get_active_mode_ventilation_party(self) -> None:
        """Test get active mode for ventilation."""

        ventilation = Ventilation(operating_mode=OperatingModes.NIGHT,
                                  target_high=5)
        system = System(ventilation=ventilation, quick_mode=QuickModes.PARTY)

        active_mode = system.get_active_mode_ventilation()

        self.assertEqual(QuickModes.PARTY, active_mode.current)
        self.assertEqual(ventilation.target_high, active_mode.target)
Exemplo n.º 2
0
    def test_get_active_mode_ventilation_night(self) -> None:
        """Test get active mode for ventilation."""

        ventilation = Ventilation(operating_mode=OperatingModes.NIGHT,
                                  target_low=3)
        system = System(ventilation=ventilation)

        active_mode = system.get_active_mode_ventilation()

        self.assertEqual(OperatingModes.NIGHT, active_mode.current)
        self.assertEqual(3, active_mode.target)
Exemplo n.º 3
0
    def test_get_active_mode_ventilation_day(self) -> None:
        """Test get active mode for ventilation."""

        ventilation = Ventilation(operating_mode=OperatingModes.DAY,
                                  target_high=5)
        system = System(ventilation=ventilation)

        active_mode = system.get_active_mode_ventilation()

        self.assertEqual(OperatingModes.DAY, active_mode.current)
        self.assertEqual(5, active_mode.target)
Exemplo n.º 4
0
    def test_get_active_mode_ventilation_holiday(self) -> None:
        """Test get active mode for ventilation."""
        holiday = HolidayMode(True, datetime.date.today(),
                              datetime.date.today(), 10)
        ventilation = Ventilation(operating_mode=OperatingModes.NIGHT,
                                  target_high=5)
        system = System(ventilation=ventilation, holiday=holiday)

        active_mode = system.get_active_mode_ventilation()

        self.assertEqual(QuickModes.HOLIDAY, active_mode.current)
        self.assertEqual(Ventilation.MIN_LEVEL, active_mode.target)
Exemplo n.º 5
0
    def test_get_active_mode_ventilation_system_off(self) -> None:
        """Test get active mode for ventilation."""

        ventilation = Ventilation(operating_mode=OperatingModes.NIGHT,
                                  target_high=5)
        system = System(ventilation=ventilation,
                        quick_mode=QuickModes.SYSTEM_OFF)

        active_mode = system.get_active_mode_ventilation()

        self.assertEqual(QuickModes.SYSTEM_OFF, active_mode.current)
        self.assertEqual(Ventilation.MIN_LEVEL, active_mode.target)
Exemplo n.º 6
0
    def test_get_active_mode_ventilation_one_day_away(self) -> None:
        """Test get active mode for ventilation."""

        ventilation = Ventilation(operating_mode=OperatingModes.NIGHT,
                                  target_high=5)
        system = System(ventilation=ventilation,
                        quick_mode=QuickModes.ONE_DAY_AWAY)

        active_mode = system.get_active_mode_ventilation()

        self.assertEqual(QuickModes.ONE_DAY_AWAY, active_mode.current)
        self.assertEqual(Ventilation.MIN_LEVEL, active_mode.target)
Exemplo n.º 7
0
    def test_get_active_mode_ventilation_quick_mode_boost(self) -> None:
        """Test get active mode for ventilation."""

        ventilation = Ventilation(operating_mode=OperatingModes.NIGHT,
                                  target_high=5)
        system = System(ventilation=ventilation,
                        quick_mode=QuickModes.VENTILATION_BOOST)

        active_mode = system.get_active_mode_ventilation()

        self.assertEqual(QuickModes.VENTILATION_BOOST, active_mode.current)
        self.assertEqual(Ventilation.MAX_LEVEL, active_mode.target)