Upgrade psutil to 5.4.6 (#14892)

This commit is contained in:
Fabian Affolter 2018-06-10 11:37:58 +02:00 committed by GitHub
parent 5f4aa6d2ba
commit 54e87836f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -10,13 +10,12 @@ import os
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_RESOURCES, STATE_OFF, STATE_ON, STATE_UNKNOWN, CONF_TYPE)
from homeassistant.const import CONF_RESOURCES, STATE_OFF, STATE_ON, CONF_TYPE
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
REQUIREMENTS = ['psutil==5.4.5']
REQUIREMENTS = ['psutil==5.4.6']
_LOGGER = logging.getLogger(__name__)
@ -157,19 +156,19 @@ class SystemMonitorSensor(Entity):
counter = counters[self.argument][IO_COUNTER[self.type]]
self._state = round(counter / 1024**2, 1)
else:
self._state = STATE_UNKNOWN
self._state = None
elif self.type == 'packets_out' or self.type == 'packets_in':
counters = psutil.net_io_counters(pernic=True)
if self.argument in counters:
self._state = counters[self.argument][IO_COUNTER[self.type]]
else:
self._state = STATE_UNKNOWN
self._state = None
elif self.type == 'ipv4_address' or self.type == 'ipv6_address':
addresses = psutil.net_if_addrs()
if self.argument in addresses:
self._state = addresses[self.argument][IF_ADDRS[self.type]][1]
else:
self._state = STATE_UNKNOWN
self._state = None
elif self.type == 'last_boot':
self._state = dt_util.as_local(
dt_util.utc_from_timestamp(psutil.boot_time())

View File

@ -672,7 +672,7 @@ proliphix==0.4.1
prometheus_client==0.1.0
# homeassistant.components.sensor.systemmonitor
psutil==5.4.5
psutil==5.4.6
# homeassistant.components.wink
pubnubsub-handler==1.0.2