Skip to content
Snippets Groups Projects
Commit 57446cfb authored by Fabian Affolter's avatar Fabian Affolter
Browse files

Add link to docs

parent ff6cb2b4
No related branches found
No related tags found
No related merge requests found
......@@ -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",)
......
......@@ -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"
......
"""
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment