Add link to docs

This commit is contained in:
Fabian Affolter 2016-02-12 07:54:25 +01:00
parent ff6cb2b452
commit 57446cfb08
3 changed files with 13 additions and 7 deletions

View File

@ -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",)

View File

@ -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"

View File

@ -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