mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
move import to top-level (#27352)
This commit is contained in:
parent
0cc2d0d557
commit
d337b71725
@ -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…
x
Reference in New Issue
Block a user