mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Upgrade psutil to 5.4.6 (#14892)
This commit is contained in:
parent
5f4aa6d2ba
commit
54e87836f6
@ -10,13 +10,12 @@ import os
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_RESOURCES, STATE_OFF, STATE_ON, CONF_TYPE
|
||||||
CONF_RESOURCES, STATE_OFF, STATE_ON, STATE_UNKNOWN, CONF_TYPE)
|
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
REQUIREMENTS = ['psutil==5.4.5']
|
REQUIREMENTS = ['psutil==5.4.6']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -157,19 +156,19 @@ class SystemMonitorSensor(Entity):
|
|||||||
counter = counters[self.argument][IO_COUNTER[self.type]]
|
counter = counters[self.argument][IO_COUNTER[self.type]]
|
||||||
self._state = round(counter / 1024**2, 1)
|
self._state = round(counter / 1024**2, 1)
|
||||||
else:
|
else:
|
||||||
self._state = STATE_UNKNOWN
|
self._state = None
|
||||||
elif self.type == 'packets_out' or self.type == 'packets_in':
|
elif self.type == 'packets_out' or self.type == 'packets_in':
|
||||||
counters = psutil.net_io_counters(pernic=True)
|
counters = psutil.net_io_counters(pernic=True)
|
||||||
if self.argument in counters:
|
if self.argument in counters:
|
||||||
self._state = counters[self.argument][IO_COUNTER[self.type]]
|
self._state = counters[self.argument][IO_COUNTER[self.type]]
|
||||||
else:
|
else:
|
||||||
self._state = STATE_UNKNOWN
|
self._state = None
|
||||||
elif self.type == 'ipv4_address' or self.type == 'ipv6_address':
|
elif self.type == 'ipv4_address' or self.type == 'ipv6_address':
|
||||||
addresses = psutil.net_if_addrs()
|
addresses = psutil.net_if_addrs()
|
||||||
if self.argument in addresses:
|
if self.argument in addresses:
|
||||||
self._state = addresses[self.argument][IF_ADDRS[self.type]][1]
|
self._state = addresses[self.argument][IF_ADDRS[self.type]][1]
|
||||||
else:
|
else:
|
||||||
self._state = STATE_UNKNOWN
|
self._state = None
|
||||||
elif self.type == 'last_boot':
|
elif self.type == 'last_boot':
|
||||||
self._state = dt_util.as_local(
|
self._state = dt_util.as_local(
|
||||||
dt_util.utc_from_timestamp(psutil.boot_time())
|
dt_util.utc_from_timestamp(psutil.boot_time())
|
||||||
|
@ -672,7 +672,7 @@ proliphix==0.4.1
|
|||||||
prometheus_client==0.1.0
|
prometheus_client==0.1.0
|
||||||
|
|
||||||
# homeassistant.components.sensor.systemmonitor
|
# homeassistant.components.sensor.systemmonitor
|
||||||
psutil==5.4.5
|
psutil==5.4.6
|
||||||
|
|
||||||
# homeassistant.components.wink
|
# homeassistant.components.wink
|
||||||
pubnubsub-handler==1.0.2
|
pubnubsub-handler==1.0.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user