From 1489af0ecaa5b16ca5951482a50d5136ebad5faf Mon Sep 17 00:00:00 2001 From: Daniel Hoyer Iversen Date: Fri, 24 Jul 2015 12:35:03 +0200 Subject: [PATCH] updated rfxcom sensor --- homeassistant/components/sensor/rfxtrx.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/sensor/rfxtrx.py b/homeassistant/components/sensor/rfxtrx.py index 12e6afde3d1..1b2a4643449 100644 --- a/homeassistant/components/sensor/rfxtrx.py +++ b/homeassistant/components/sensor/rfxtrx.py @@ -16,8 +16,7 @@ sensor 2: import logging from collections import OrderedDict -from homeassistant.const import ( - ATTR_BATTERY_LEVEL, TEMP_CELCIUS) +from homeassistant.const import (TEMP_CELCIUS) from homeassistant.helpers.entity import Entity REQUIREMENTS = ['https://github.com/Danielhiversen/pyRFXtrx/archive/master.zip' @@ -37,7 +36,7 @@ DATA_TYPES = OrderedDict([ ('Wind average speed', ''), ('Wind gust', ''), ('Chill', ''), - ('Battery numeric', ATTR_BATTERY_LEVEL), + ('Battery numeric', '%'), ('Rssi numeric', '')]) @@ -102,11 +101,7 @@ class RfxtrxSensor(Entity): @property def state_attributes(self): - attr = super().state_attributes - for data_type in DATA_TYPES: - if data_type in self.event.values: - attr[data_type] = self.event.values[data_type] - return attr + return self.event.values @property def unit_of_measurement(self):