Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
fixing travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasgermain committed Oct 9, 2019
1 parent 689f7f0 commit 12c0fee
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 36 deletions.
4 changes: 2 additions & 2 deletions tests/test_boilerstatus.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Tests for boiler status."""
from datetime import datetime
from datetime import datetime
import unittest

from vr900connector.model import BoilerStatus
Expand All @@ -10,7 +10,7 @@ class BoilerStatusTest(unittest.TestCase):

def test_status_error_con(self) -> None:
"""Error code 'con' means error."""
status = BoilerStatus('Name', 'title', 'con', 'desc', datetime.now(),
status = BoilerStatus('Name', 'title', 'con', 'desc', datetime.now(),
'hint', None, None)
self.assertTrue(status.is_error)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_hot_water.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ def test_get_active_mode_off(self) -> None:
active_mode = hot_water.active_mode

self.assertEqual(OperatingModes.OFF, active_mode.current_mode)
self.assertEqual(HotWater.MIN_TARGET_TEMP, active_mode.target_temperature)
self.assertEqual(HotWater.MIN_TARGET_TEMP,
active_mode.target_temperature)
self.assertIsNone(active_mode.sub_mode)
14 changes: 9 additions & 5 deletions tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def test_get_active_mode_hot_water_off(self) -> None:

self.assertEqual(OperatingModes.AUTO, active_mode.current_mode)
self.assertEqual(SettingModes.OFF, active_mode.sub_mode)
self.assertEqual(HotWater.MIN_TARGET_TEMP, active_mode.target_temperature)
self.assertEqual(HotWater.MIN_TARGET_TEMP,
active_mode.target_temperature)

def test_get_active_mode_hot_water_system_off(self) -> None:
"""Test active mode hot water system off."""
Expand All @@ -124,7 +125,8 @@ def test_get_active_mode_hot_water_system_off(self) -> None:
active_mode = system.get_active_mode_hot_water()

self.assertEqual(QuickModes.SYSTEM_OFF, active_mode.current_mode)
self.assertEqual(HotWater.MIN_TARGET_TEMP, active_mode.target_temperature)
self.assertEqual(HotWater.MIN_TARGET_TEMP,
active_mode.target_temperature)

def test_get_active_mode_hot_water_one_day_away(self) -> None:
"""Test get active mode for hot water with one day away."""
Expand All @@ -138,7 +140,8 @@ def test_get_active_mode_hot_water_one_day_away(self) -> None:
active_mode = system.get_active_mode_hot_water()

self.assertEqual(QuickModes.ONE_DAY_AWAY, active_mode.current_mode)
self.assertEqual(HotWater.MIN_TARGET_TEMP, active_mode.target_temperature)
self.assertEqual(HotWater.MIN_TARGET_TEMP,
active_mode.target_temperature)

def test_get_active_mode_hot_water_hot_water_boost(self) -> None:
"""Test get active mode for hot water with hot water boost."""
Expand Down Expand Up @@ -169,7 +172,8 @@ def test_get_active_mode_hot_water_holiday_mode(self) -> None:
active_mode = system.get_active_mode_hot_water()

self.assertEqual(QuickModes.HOLIDAY, active_mode.current_mode)
self.assertEqual(HotWater.MIN_TARGET_TEMP, active_mode.target_temperature)
self.assertEqual(HotWater.MIN_TARGET_TEMP,
active_mode.target_temperature)

def test_get_active_mode_zone(self) -> None:
"""Test get active mode for zone."""
Expand Down Expand Up @@ -269,7 +273,7 @@ def test_get_active_mode_zone_quick_mode_one_day_home(self) -> None:
"""Test get active mode for zone one day home."""

timeprogram_day_setting_sunday = \
TimePeriodSetting('00:00', 25, OperatingModes.DAY)
TimePeriodSetting('00:00', 25, SettingModes.DAY)

timeprogram = testutil.default_time_program(SettingModes.DAY, 20)
timeprogram.days['sunday'] = \
Expand Down
16 changes: 8 additions & 8 deletions tests/test_timeprogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from datetime import datetime

from vr900connector.model import TimePeriodSetting, TimeProgramDay, \
TimeProgram, OperatingModes
TimeProgram, SettingModes


class TimeProgramTest(unittest.TestCase):

def test_time_program_simple(self) -> None:
tpds1 = TimePeriodSetting('00:00', 25, OperatingModes.ON)
tpds2 = TimePeriodSetting('02:00', 20, OperatingModes.OFF)
tpds1 = TimePeriodSetting('00:00', 25, SettingModes.ON)
tpds2 = TimePeriodSetting('02:00', 20, SettingModes.OFF)

monday = TimeProgramDay([tpds1, tpds2])

Expand All @@ -24,8 +24,8 @@ def test_time_program_simple(self) -> None:
self._assert(tpds1, current)

def test_time_program_after_last(self) -> None:
tpds1 = TimePeriodSetting('00:00', 25, OperatingModes.ON)
tpds2 = TimePeriodSetting('02:00', 20, OperatingModes.OFF)
tpds1 = TimePeriodSetting('00:00', 25, SettingModes.ON)
tpds2 = TimePeriodSetting('02:00', 20, SettingModes.OFF)

monday = TimeProgramDay([tpds1, tpds2])

Expand All @@ -40,10 +40,10 @@ def test_time_program_after_last(self) -> None:
self._assert(tpds2, current)

def test_time_program_before_first(self) -> None:
tpds1 = TimePeriodSetting('01:00', 25, OperatingModes.ON)
tpds2 = TimePeriodSetting('02:00', 20, OperatingModes.OFF)
tpds1 = TimePeriodSetting('01:00', 25, SettingModes.ON)
tpds2 = TimePeriodSetting('02:00', 20, SettingModes.OFF)

tpds_sunday = TimePeriodSetting('15:00', 15, OperatingModes.OFF)
tpds_sunday = TimePeriodSetting('15:00', 15, SettingModes.OFF)

sunday = TimeProgramDay([tpds_sunday])
monday = TimeProgramDay([tpds1, tpds2])
Expand Down
1 change: 1 addition & 0 deletions vr900connector/model/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Component:
`None` for :class:`Circulation` and :class:`HotWater`.
"""

# pylint: disable=invalid-name
id = attr.ib(type=str)
name = attr.ib(type=Optional[str])
time_program = attr.ib(type=TimeProgram)
Expand Down
2 changes: 1 addition & 1 deletion vr900connector/model/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def map_boiler_status(hvac_state, live_report) -> Optional[BoilerStatus]:
if hvac_state:
hvac_state_info = _find_hvac_message_status(hvac_state)
if hvac_state_info:
last_update = _datetime(hvac_state_info.get("timestamp"))
last_update = _datetime_mandatory(hvac_state_info.get("timestamp"))
device_name = str(hvac_state_info.get("deviceName"))
code = str(hvac_state_info.get("statusCode"))
title = str(hvac_state_info.get("title"))
Expand Down
2 changes: 1 addition & 1 deletion vr900connector/model/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class QuickModes:
:class:`~vr900connector.model.component.Room` are not affected.
"""

# TODO check what's happening with party mode for a room, according to doc,
# check what's happening with party mode for a room, according to doc,
# this has impact on room, it should use DAY temperature from the
# controlled zone
PARTY = QuickMode('QM_PARTY', True, True, False)
Expand Down
4 changes: 2 additions & 2 deletions vr900connector/model/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class Error:
# pylint: disable=too-few-public-methods
@attr.s
class BoilerStatus(Error):
"""Status of the boiler. This is sent with an error format, but in this case
, it's more like a status.
"""Status of the boiler. This is sent with an error format, but in this
case, it's more like a status.
Args:
hint (str): Directly coming from the API, most of the time the value is
Expand Down
7 changes: 4 additions & 3 deletions vr900connector/model/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Circulation, QuickMode, QuickModes, Error, SystemStatus


# pylint: disable=too-many-instance-attributes
@attr.s
class System:
"""This class represents the main class to manipulate vaillant system. It
Expand Down Expand Up @@ -138,7 +139,7 @@ def get_active_mode_room(self, room: Room) -> ActiveMode:

# Global system quick mode takes over room settings
if self.quick_mode and self.quick_mode.for_room:
# TODO party quick mode
# party quick mode
if self.quick_mode == QuickModes.SYSTEM_OFF:
return ActiveMode(Room.MIN_TARGET_TEMP, self.quick_mode)

Expand All @@ -154,8 +155,8 @@ def get_active_mode_circulation(self,
Args:
circulation (Circulation): The circulation you want the active mode
for. If ``None`` is passed, it will pick up the circulation from the
system.
for. If ``None`` is passed, it will pick up the circulation from
the system.
Returns:
ActiveMode: The active mode.
Expand Down
6 changes: 3 additions & 3 deletions vr900connector/model/timeprogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class TimePeriodSetting:
Args:
start_time (str): Start time of the period, format is HH:mm.
target_temperature (float): Target temperature to reach during this time
period, target temperature is only available for
target_temperature (float): Target temperature to reach during this
time period, target temperature is only available for
:class:`~vr900connector.model.component.Room`.
setting (SettingMode): The setting configured, see
:class:`~vr900connector.model.mode.SettingModes`, this is not
Expand Down Expand Up @@ -77,7 +77,7 @@ class TimeProgramDay:
@attr.s
class TimeProgram:
"""This is the full time program, a week, reflecting the configuration done
hrough mobile app.
through mobile app.
Args:
days (Dict[str, TimeProgramDay]): Days of the week.
Expand Down
20 changes: 10 additions & 10 deletions vr900connector/systemmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ def get_system(self) -> System:
hot_water, circulation, outdoor_temp, quick_mode, errors)

def get_hot_water(self, dhw_id: str) -> Optional[HotWater]:
"""Get the :class:`~vr900connector.model.component.HotWater` information
for the given id.
"""Get the :class:`~vr900connector.model.component.HotWater`
information for the given id.
Args:
dhw_id (str): domestic hot water id (same as :func:`get_circulation`
)
dhw_id (str): domestic hot water id (same as
:func:`get_circulation`)
Returns:
HotWater: the hot water information, if any.
Expand All @@ -99,12 +99,12 @@ def get_hot_water(self, dhw_id: str) -> Optional[HotWater]:
return mapper.map_hot_water_alone(full_system, dhw_id, live_report)

def get_room(self, room_id: str) -> Optional[Room]:
"""Get the :class:`~vr900connector.model.component.Room` information for
the given id.
"""Get the :class:`~vr900connector.model.component.Room` information
for the given id.
Args:
room_id (str): Id of the room, this is actually an index, 1,2,3,4...
depending of the number of rooms you have.
room_id (str): Id of the room, this is actually an index, 1,2,3,4
... depending of the number of rooms you have.
Returns:
Room: the room information, if any.
Expand Down Expand Up @@ -412,8 +412,8 @@ def remove_holiday_mode(self) -> None:
* active to `False`
This will ensure the :class:`~vr900connector.model.mode.HolidayMode`
is not active.
This will ensure the
:class:`~vr900connector.model.mode.HolidayMode` is not active.
"""

Expand Down

0 comments on commit 12c0fee

Please sign in to comment.