diff --git a/homeassistant/components/apcupsd.py b/homeassistant/components/apcupsd.py index 8abb06b54eab708e0bb3a21cddd4ccbeeeb860d9..b7c22b3a7d9ca88fd950104b6ea6c7771889a596 100644 --- a/homeassistant/components/apcupsd.py +++ b/homeassistant/components/apcupsd.py @@ -3,13 +3,15 @@ homeassistant.components.apcupsd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets up and provides access to the status output of APCUPSd via its Network Information Server (NIS). + +For more details about this component, please refer to the documentation at +https://home-assistant.io/components/apcupsd/ """ import logging from datetime import timedelta from homeassistant.util import Throttle - DOMAIN = "apcupsd" REQUIREMENTS = ("apcaccess==0.0.4",) diff --git a/homeassistant/components/binary_sensor/apcupsd.py b/homeassistant/components/binary_sensor/apcupsd.py index 8524b06e4babfa51294644193524d539ff42004c..796a2a0df704ebc5a78393a8f47da3ebe80a52f9 100644 --- a/homeassistant/components/binary_sensor/apcupsd.py +++ b/homeassistant/components/binary_sensor/apcupsd.py @@ -2,13 +2,14 @@ homeassistant.components.binary_sensor.apcupsd ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides a binary sensor to track online status of a UPS. + +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/binary_sensor.apcupsd/ """ from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components import apcupsd - DEPENDENCIES = [apcupsd.DOMAIN] - DEFAULT_NAME = "UPS Online Status" diff --git a/homeassistant/components/sensor/apcupsd.py b/homeassistant/components/sensor/apcupsd.py index d72dc4ae4b97d7267b5b980dc5e614216574b6fe..8a5662254380a4138d9324defd66c451801f8cf0 100644 --- a/homeassistant/components/sensor/apcupsd.py +++ b/homeassistant/components/sensor/apcupsd.py @@ -1,7 +1,10 @@ """ homeassistant.components.sensor.apcupsd -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides a sensor to track various status aspects of a UPS. + +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/sensor.apcupsd/ """ import logging @@ -9,11 +12,8 @@ from homeassistant.const import TEMP_CELCIUS from homeassistant.helpers.entity import Entity from homeassistant.components import apcupsd - DEPENDENCIES = [apcupsd.DOMAIN] - DEFAULT_NAME = "UPS Status" - SPECIFIC_UNITS = { "ITEMP": TEMP_CELCIUS } @@ -69,14 +69,17 @@ class Sensor(Entity): @property def name(self): + """ The name of the UPS sensor. """ return self._config.get("name", DEFAULT_NAME) @property def state(self): + """ True if the UPS is online, else False. """ return self._state @property def unit_of_measurement(self): + """ Unit of measurement of this entity, if any. """ if self._unit is None: return self._inferred_unit return self._unit