Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
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.º 4
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.º 5
0
    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)
Exemplo n.º 6
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.º 7
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.º 8
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.º 9
0
    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)
Exemplo n.º 10
0
    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)
Exemplo n.º 11
0
    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)
Exemplo n.º 12
0
    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)
Exemplo n.º 13
0
    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)
Exemplo n.º 14
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)
Exemplo n.º 15
0
    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)