Fix broken tellstick and systemmonitor sensors
This commit is contained in:
1 parent
49d7901585
commit
ec557f8d44
2 files changed
+10
-2
No files matched your search
@@ -50,7 +50,7 @@ class SystemMonitorSensor(Entity):
|
||||
self.argument = argument
|
||||
self.type = sensor_type
|
||||
self._state = None
|
||||
self.unit_of_measurement = SENSOR_TYPES[sensor_type][1]
|
||||
self._unit_of_measurement = SENSOR_TYPES[sensor_type][1]
|
||||
self.update()
|
||||
|
||||
@property
|
||||
@@ -62,6 +62,10 @@ class SystemMonitorSensor(Entity):
|
||||
""" Returns the state of the device. """
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def unit_of_measurement(self):
|
||||
return self._unit_of_measurement
|
||||
|
||||
def update(self):
|
||||
if self.type == 'disk_use_percent':
|
||||
self._state = psutil.disk_usage(self.argument).percent
|
||||
|
||||
Reference in new issue
Block a user