Beispiel #1
0
    def test_get_active_mode_zone_quick_mode_ventilation(self) -> None:
        """Test get active mode for zone quick mode ventilation."""
        zone = _zone()
        system = System(zones=[zone], quick_mode=QuickModes.VENTILATION_BOOST)

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(QuickModes.VENTILATION_BOOST, active_mode.current)
        self.assertEqual(Zone.MIN_TARGET_HEATING_TEMP, active_mode.target)
Beispiel #2
0
    def test_get_active_mode_zone_quick_mode_party(self) -> None:
        """Test get active mode for zone quick mode party."""
        zone = _zone()
        system = System(zones=[zone], quick_mode=QuickModes.PARTY)

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(QuickModes.PARTY, active_mode.current)
        self.assertEqual(zone.heating.target_high, active_mode.target)
Beispiel #3
0
    def test_get_active_mode_zone_quick_mode_system_off(self) -> None:
        """Test get active mode for zone with system off."""
        zone = _zone()
        system = System(zones=[zone], quick_mode=QuickModes.SYSTEM_OFF)

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(QuickModes.SYSTEM_OFF, active_mode.current)
        self.assertEqual(Zone.MIN_TARGET_HEATING_TEMP, active_mode.target)
Beispiel #4
0
    def test_get_active_mode_zone_quick_mode_one_day_away(self) -> None:
        """Test get active mode for zone one day away."""
        zone = _zone()
        system = System(zones=[zone], quick_mode=QuickModes.ONE_DAY_AWAY)

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(QuickModes.ONE_DAY_AWAY, active_mode.current)
        self.assertEqual(Zone.MIN_TARGET_HEATING_TEMP, active_mode.target)
Beispiel #5
0
    def test_get_active_mode_zone_cooling_for_x_days(self) -> None:
        """Test quick mode COOLING_FOR_X_DAYS."""
        zone = _zone_cooling()
        system = System(zones=[zone], quick_mode=QuickModes.COOLING_FOR_X_DAYS)

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(QuickModes.COOLING_FOR_X_DAYS, active_mode.current)
        self.assertIsNone(active_mode.sub)
        self.assertEqual(zone.cooling.target_high, active_mode.target)
Beispiel #6
0
    def test_get_active_mode_zone_quick_mode_water_boost(self) -> None:
        """Test get active mode for zone with hot water boost."""
        zone = _zone()
        system = System(zones=[zone], quick_mode=QuickModes.HOTWATER_BOOST)

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(OperatingModes.AUTO, active_mode.current)
        self.assertEqual(SettingModes.DAY, active_mode.sub)
        self.assertEqual(zone.heating.target_high, active_mode.target)
Beispiel #7
0
    def test_get_active_mode_zone(self) -> None:
        """Test get active mode for zone."""

        zone = _zone()
        system = System(zones=[zone])

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(OperatingModes.AUTO, active_mode.current)
        self.assertEqual(SettingModes.DAY, active_mode.sub)
        self.assertEqual(zone.heating.target_high, active_mode.target)
Beispiel #8
0
    def test_get_active_mode_zone_quick_mode_quick_veto(self) -> None:
        """Test get active mode for zone quick mode + quick veto."""
        quick_veto = QuickVeto(target=15)
        zone = _zone()
        zone.quick_veto = quick_veto

        system = System(zones=[zone])

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(OperatingModes.QUICK_VETO, active_mode.current)
        self.assertEqual(zone.quick_veto.target, active_mode.target)
Beispiel #9
0
    def test_get_active_mode_zone_holiday_mode(self) -> None:
        """Test get active mode for zone with holiday mode."""
        holiday = HolidayMode(True, datetime.date.today(),
                              datetime.date.today(), 10)

        zone = _zone()
        system = System(holiday=holiday, zones=[zone])

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(QuickModes.HOLIDAY, active_mode.current)
        self.assertEqual(holiday.target, active_mode.target)
Beispiel #10
0
    def test_get_active_mode_zone_off(self) -> None:
        """Test get active mode for zone off."""
        zone = _zone()
        zone.heating.time_program = _time_program(SettingModes.NIGHT)

        system = System(zones=[zone])

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(OperatingModes.AUTO, active_mode.current)
        self.assertEqual(SettingModes.NIGHT, active_mode.sub)
        self.assertEqual(zone.heating.target_low, active_mode.target)
Beispiel #11
0
    def test_get_active_mode_zone_quick_mode_one_day_home_day(self) -> None:
        """Test get active mode for zone one day home."""

        timeprogram_day_setting_sunday = TimePeriodSetting(
            "00:00", None, SettingModes.DAY)

        timeprogram = _time_program(SettingModes.NIGHT, None)
        timeprogram.days["sunday"] = TimeProgramDay(
            [timeprogram_day_setting_sunday])

        zone = _zone()
        zone.heating.time_program = timeprogram
        system = System(zones=[zone], quick_mode=QuickModes.ONE_DAY_AT_HOME)

        active_mode = system.get_active_mode_zone(zone)

        self.assertEqual(QuickModes.ONE_DAY_AT_HOME, active_mode.current)
        self.assertEqual(zone.heating.target_high, active_mode.target)