move import to top-level (#27352)
This commit is contained in:
parent
0cc2d0d557
commit
d337b71725
1 changed files with 1 additions and 2 deletions
|
@ -3,6 +3,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
import psutil
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
|
@ -134,8 +135,6 @@ class SystemMonitorSensor(Entity):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest system information."""
|
"""Get the latest system information."""
|
||||||
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…
Add table
Reference in a new issue