updated rfxcom sensor
parent
b54c58235f
commit
1489af0eca
|
@ -16,8 +16,7 @@ sensor 2:
|
||||||
import logging
|
import logging
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (TEMP_CELCIUS)
|
||||||
ATTR_BATTERY_LEVEL, TEMP_CELCIUS)
|
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
|
||||||
REQUIREMENTS = ['https://github.com/Danielhiversen/pyRFXtrx/archive/master.zip'
|
REQUIREMENTS = ['https://github.com/Danielhiversen/pyRFXtrx/archive/master.zip'
|
||||||
|
@ -37,7 +36,7 @@ DATA_TYPES = OrderedDict([
|
||||||
('Wind average speed', ''),
|
('Wind average speed', ''),
|
||||||
('Wind gust', ''),
|
('Wind gust', ''),
|
||||||
('Chill', ''),
|
('Chill', ''),
|
||||||
('Battery numeric', ATTR_BATTERY_LEVEL),
|
('Battery numeric', '%'),
|
||||||
('Rssi numeric', '')])
|
('Rssi numeric', '')])
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,11 +101,7 @@ class RfxtrxSensor(Entity):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
attr = super().state_attributes
|
return self.event.values
|
||||||
for data_type in DATA_TYPES:
|
|
||||||
if data_type in self.event.values:
|
|
||||||
attr[data_type] = self.event.values[data_type]
|
|
||||||
return attr
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
|
|
Loading…
Reference in New Issue