mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Fix sensor.systemmonitor
This commit is contained in:
parent
965730eb60
commit
2df26a0d1a
@ -59,7 +59,6 @@ arg
|
|||||||
Additional details for the type, eg. path, binary name, etc.
|
Additional details for the type, eg. path, binary name, etc.
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import psutil
|
|
||||||
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
@ -133,6 +132,7 @@ class SystemMonitorSensor(Entity):
|
|||||||
|
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
def update(self):
|
def update(self):
|
||||||
|
import psutil
|
||||||
if self.type == 'disk_use_percent':
|
if self.type == 'disk_use_percent':
|
||||||
self._state = psutil.disk_usage(self.argument).percent
|
self._state = psutil.disk_usage(self.argument).percent
|
||||||
elif self.type == 'disk_use':
|
elif self.type == 'disk_use':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user