minor bug in rfxtrx sensor
This commit is contained in:
parent
4795122463
commit
99796e559e
1 changed files with 2 additions and 2 deletions
|
@ -41,7 +41,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
sub_sensors = {}
|
sub_sensors = {}
|
||||||
data_types = entity_info[ATTR_DATA_TYPE]
|
data_types = entity_info[ATTR_DATA_TYPE]
|
||||||
if len(data_types) == 0:
|
if len(data_types) == 0:
|
||||||
data_type = "Unknown"
|
data_types = ["Unknown"]
|
||||||
for data_type in DATA_TYPES:
|
for data_type in DATA_TYPES:
|
||||||
if data_type in event.values:
|
if data_type in event.values:
|
||||||
data_types = [data_type]
|
data_types = [data_type]
|
||||||
|
@ -121,7 +121,7 @@ class RfxtrxSensor(Entity):
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
if self.event:
|
if self.event and self.data_type in self.event.values:
|
||||||
return self.event.values[self.data_type]
|
return self.event.values[self.data_type]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue