mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Update docstrings
This commit is contained in:
parent
06cac7f9ef
commit
d8aefb5d55
@ -3,21 +3,8 @@ homeassistant.components.sensor.rfxtrx
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Shows sensor values from RFXtrx sensors.
|
Shows sensor values from RFXtrx sensors.
|
||||||
|
|
||||||
Configuration:
|
For more details about this platform, please refer to the documentation at
|
||||||
|
https://home-assistant.io/components/sensor.rfxtrx.html
|
||||||
To use the rfxtrx sensors you will need to add something like the following to
|
|
||||||
your configuration.yaml file.
|
|
||||||
|
|
||||||
sensor:
|
|
||||||
platform: rfxtrx
|
|
||||||
device: PATH_TO_DEVICE
|
|
||||||
|
|
||||||
Variables:
|
|
||||||
|
|
||||||
device
|
|
||||||
*Required
|
|
||||||
Path to your RFXtrx device.
|
|
||||||
E.g. /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Y0NJGR-if00-port0
|
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
@ -67,7 +54,6 @@ class RfxtrxSensor(Entity):
|
|||||||
|
|
||||||
def __init__(self, event):
|
def __init__(self, event):
|
||||||
self.event = event
|
self.event = event
|
||||||
|
|
||||||
self._unit_of_measurement = None
|
self._unit_of_measurement = None
|
||||||
self._data_type = None
|
self._data_type = None
|
||||||
for data_type in DATA_TYPES:
|
for data_type in DATA_TYPES:
|
||||||
@ -86,13 +72,14 @@ class RfxtrxSensor(Entity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
""" Returns the state of the device. """
|
||||||
if self._data_type:
|
if self._data_type:
|
||||||
return self.event.values[self._data_type]
|
return self.event.values[self._data_type]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
""" Get the mame of the sensor. """
|
""" Get the name of the sensor. """
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user