Fixed attribute error with new unit_of_measurement changes

This commit is contained in:
jamespcole 2015-03-22 14:43:20 +11:00
parent e872435870
commit e877ed01af

View File

@ -118,7 +118,7 @@ class SabnzbdSensor(Entity):
self.type = sensor_type self.type = sensor_type
self.client_name = client_name self.client_name = client_name
self._state = None self._state = None
self.unit_of_measurement = SENSOR_TYPES[sensor_type][1] self._unit_of_measurement = SENSOR_TYPES[sensor_type][1]
@property @property
def name(self): def name(self):
@ -134,7 +134,7 @@ class SabnzbdSensor(Entity):
""" Returns the state attributes. """ """ Returns the state attributes. """
return { return {
ATTR_FRIENDLY_NAME: self.name, ATTR_FRIENDLY_NAME: self.name,
ATTR_UNIT_OF_MEASUREMENT: self.unit_of_measurement, ATTR_UNIT_OF_MEASUREMENT: self._unit_of_measurement,
} }
def refresh_sabnzbd_data(self): def refresh_sabnzbd_data(self):