Exemplo n.º 1
0
    def test_get_active_mode_circulation_auto(self) -> None:
        """Test get active mode for circulation."""
        dhw = Dhw(circulation=_circulation())
        system = System(dhw=dhw)

        active_mode = system.get_active_mode_circulation()

        self.assertEqual(OperatingModes.AUTO, active_mode.current)
        self.assertIsNone(active_mode.target)
        self.assertEqual(SettingModes.ON, active_mode.sub)
Exemplo n.º 2
0
    def test_get_active_mode_on(self) -> None:
        """Get active mode when operation mode is ON."""
        circulation = _circulation()
        circulation.operating_mode = OperatingModes.ON

        active_mode = circulation.active_mode

        self.assertEqual(OperatingModes.ON, active_mode.current)
        self.assertIsNone(active_mode.target)
        self.assertIsNone(active_mode.sub)
Exemplo n.º 3
0
    def test_get_active_mode_circulation_off(self) -> None:
        """Test active mode for circulation off."""
        dhw = Dhw(circulation=_circulation())
        system = System(quick_mode=QuickModes.SYSTEM_OFF, dhw=dhw)

        active_mode = system.get_active_mode_circulation()

        self.assertEqual(QuickModes.SYSTEM_OFF, active_mode.current)
        self.assertIsNone(active_mode.target)
        self.assertIsNone(active_mode.sub)
Exemplo n.º 4
0
    def test_get_active_mode_circulation_no_timeprogram_on(self) -> None:
        """Test get active mode for circulation."""

        dhw = Dhw(circulation=_circulation())
        dhw.circulation.time_program = None
        dhw.circulation.operating_mode = OperatingModes.ON
        system = System(dhw=dhw)

        active_mode = system.get_active_mode_circulation()

        self.assertEqual(OperatingModes.ON, active_mode.current)
Exemplo n.º 5
0
    def test_get_active_mode_circulation_empty_timeprogram(self) -> None:
        """Test get active mode for circulation."""

        dhw = Dhw(circulation=_circulation())
        dhw.circulation.time_program = TimeProgram(days={})
        system = System(dhw=dhw)

        active_mode = system.get_active_mode_circulation()

        self.assertEqual(OperatingModes.AUTO, active_mode.current)
        self.assertEqual(SettingModes.OFF, active_mode.sub)
Exemplo n.º 6
0
    def test_get_active_mode_circulation_hot_water_boost(self) -> None:
        """Test get active mode for circulation with hotwater boost."""
        dhw = Dhw(circulation=_circulation())

        system = System(quick_mode=QuickModes.HOTWATER_BOOST, dhw=dhw)

        active_mode = system.get_active_mode_circulation()

        self.assertEqual(QuickModes.HOTWATER_BOOST, active_mode.current)
        self.assertIsNone(active_mode.target)
        self.assertIsNone(active_mode.sub)
Exemplo n.º 7
0
    def test_get_active_mode_circulation_holiday(self) -> None:
        """Test get active mode for circulation with holiday mode."""
        dhw = Dhw(circulation=_circulation())

        holiday = HolidayMode(True, datetime.date.today(),
                              datetime.date.today(), 10)

        system = System(holiday=holiday, dhw=dhw)

        active_mode = system.get_active_mode_circulation()

        self.assertEqual(QuickModes.HOLIDAY, active_mode.current)
        self.assertIsNone(active_mode.target)
        self.assertIsNone(active_mode.sub)