mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add link to docs
This commit is contained in:
parent
ff6cb2b452
commit
57446cfb08
@ -3,13 +3,15 @@ homeassistant.components.apcupsd
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Sets up and provides access to the status output of APCUPSd via its Network
|
Sets up and provides access to the status output of APCUPSd via its Network
|
||||||
Information Server (NIS).
|
Information Server (NIS).
|
||||||
|
|
||||||
|
For more details about this component, please refer to the documentation at
|
||||||
|
https://home-assistant.io/components/apcupsd/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
|
|
||||||
DOMAIN = "apcupsd"
|
DOMAIN = "apcupsd"
|
||||||
REQUIREMENTS = ("apcaccess==0.0.4",)
|
REQUIREMENTS = ("apcaccess==0.0.4",)
|
||||||
|
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
homeassistant.components.binary_sensor.apcupsd
|
homeassistant.components.binary_sensor.apcupsd
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Provides a binary sensor to track online status of a UPS.
|
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.binary_sensor import BinarySensorDevice
|
||||||
from homeassistant.components import apcupsd
|
from homeassistant.components import apcupsd
|
||||||
|
|
||||||
|
|
||||||
DEPENDENCIES = [apcupsd.DOMAIN]
|
DEPENDENCIES = [apcupsd.DOMAIN]
|
||||||
|
|
||||||
DEFAULT_NAME = "UPS Online Status"
|
DEFAULT_NAME = "UPS Online Status"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.sensor.apcupsd
|
homeassistant.components.sensor.apcupsd
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Provides a sensor to track various status aspects of a UPS.
|
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
|
import logging
|
||||||
|
|
||||||
@ -9,11 +12,8 @@ from homeassistant.const import TEMP_CELCIUS
|
|||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.components import apcupsd
|
from homeassistant.components import apcupsd
|
||||||
|
|
||||||
|
|
||||||
DEPENDENCIES = [apcupsd.DOMAIN]
|
DEPENDENCIES = [apcupsd.DOMAIN]
|
||||||
|
|
||||||
DEFAULT_NAME = "UPS Status"
|
DEFAULT_NAME = "UPS Status"
|
||||||
|
|
||||||
SPECIFIC_UNITS = {
|
SPECIFIC_UNITS = {
|
||||||
"ITEMP": TEMP_CELCIUS
|
"ITEMP": TEMP_CELCIUS
|
||||||
}
|
}
|
||||||
@ -69,14 +69,17 @@ class Sensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
""" The name of the UPS sensor. """
|
||||||
return self._config.get("name", DEFAULT_NAME)
|
return self._config.get("name", DEFAULT_NAME)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
""" True if the UPS is online, else False. """
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
|
""" Unit of measurement of this entity, if any. """
|
||||||
if self._unit is None:
|
if self._unit is None:
|
||||||
return self._inferred_unit
|
return self._inferred_unit
|
||||||
return self._unit
|
return self._unit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user