From 1ed8e58679bbd7d706d6c586ee434b8fa1bc0c0c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 7 Sep 2015 19:05:37 +0200 Subject: [PATCH] Update docstring (config file) and attempt to honor PEP0257 --- homeassistant/components/thermostat/demo.py | 5 ++--- .../components/thermostat/heat_control.py | 19 +++++++++---------- homeassistant/components/thermostat/nest.py | 4 +++- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/thermostat/demo.py b/homeassistant/components/thermostat/demo.py index 0ecbd889edd..9ad9e8995cd 100644 --- a/homeassistant/components/thermostat/demo.py +++ b/homeassistant/components/thermostat/demo.py @@ -3,7 +3,6 @@ homeassistant.components.thermostat.demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo platform that offers a fake thermostat. - """ from homeassistant.components.thermostat import ThermostatDevice from homeassistant.const import TEMP_CELCIUS, TEMP_FAHRENHEIT @@ -19,7 +18,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): # pylint: disable=too-many-arguments class DemoThermostat(ThermostatDevice): - """ Represents a HeatControl within Home Assistant. """ + """ Represents a HeatControl thermostat. """ def __init__(self, name, target_temperature, unit_of_measurement, away, current_temperature): @@ -60,7 +59,7 @@ class DemoThermostat(ThermostatDevice): return self._away def set_temperature(self, temperature): - """ Set new target temperature """ + """ Set new target temperature. """ self._target_temperature = temperature def turn_away_mode_on(self): diff --git a/homeassistant/components/thermostat/heat_control.py b/homeassistant/components/thermostat/heat_control.py index 7eb3030f0d4..f77d4285544 100644 --- a/homeassistant/components/thermostat/heat_control.py +++ b/homeassistant/components/thermostat/heat_control.py @@ -1,4 +1,6 @@ """ +homeassistant.components.thermostat.heat_control +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adds support for a thermostat. Specify a start time, end time and a target temperature. @@ -12,8 +14,8 @@ temperature (min_temp in config). The min temperature is also used as target temperature when no other temperature is specified. If the heater is manually turned on, the target temperature will -be sat to 100*C. Meaning -the thermostat probably will never turn off the heater. +be sat to 100*C. Meaning the thermostat probably will never turn +off the heater. If the heater is manually turned off, the target temperature will be sat according to normal rules. (Based on target temperature for given time intervals and the min temperature.) @@ -21,7 +23,6 @@ for given time intervals and the min temperature.) A target temperature sat with the set_temperature function will override all other rules for the target temperature. - Config: [thermostat] @@ -55,9 +56,7 @@ target temperature will be 17*C. Between 0745 and 1500 no temperature is specified. so the min_temp of 10*C will be used. From 1500 to 1850 the target temperature is 20*, but if away mode is true the target temperature will be sat to 10*C - """ - import logging import datetime import homeassistant.components as core @@ -80,7 +79,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): # pylint: disable=too-many-instance-attributes class HeatControl(ThermostatDevice): - """ Represents a HeatControl within Home Assistant. """ + """ Represents a HeatControl device. """ def __init__(self, hass, config, logger): @@ -150,14 +149,14 @@ class HeatControl(ThermostatDevice): return self.min_temp def set_temperature(self, temperature): - """ Set new target temperature """ + """ Set new target temperature. """ if temperature is None: self._manual_sat_temp = None else: self._manual_sat_temp = float(temperature) def update(self): - """ Update current thermostat """ + """ Update current thermostat. """ heater = self.hass.states.get(self.heater_entity_id) if heater is None: self.logger.error("No heater available") @@ -178,7 +177,7 @@ class HeatControl(ThermostatDevice): core.turn_on(self.hass, self.heater_entity_id) def _heater_turned_on(self, entity_id, old_state, new_state): - """ heater is turned on""" + """ Heater is turned on. """ if not self._heater_manual_changed: pass else: @@ -187,7 +186,7 @@ class HeatControl(ThermostatDevice): self._heater_manual_changed = True def _heater_turned_off(self, entity_id, old_state, new_state): - """ heater is turned off""" + """ Heater is turned off. """ if self._heater_manual_changed: self.set_temperature(None) diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index d165e8e7820..72f10033a91 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -1,4 +1,6 @@ """ +homeassistant.components.thermostat.nest +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Adds support for Nest thermostats. """ import logging @@ -41,7 +43,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class NestThermostat(ThermostatDevice): - """ Represents a Nest thermostat within Home Assistant. """ + """ Represents a Nest thermostat. """ def __init__(self, structure, device): self.structure = structure