80136f3591b0580a38ac9ef2babf2f79fd444272,homeassistant/components/systemmonitor/sensor.py,SystemMonitorSensor,update,#SystemMonitorSensor#,136

Before Change


            counters = psutil.net_io_counters(pernic=True)
            if self.argument in counters:
                counter = counters[self.argument][IO_COUNTER[self.type]]
                now = datetime.now()
                if self._last_value and self._last_value < counter:
                    self._state = round(
                        (counter - self._last_value)
                        / 1000 ** 2
                        / (now - self._last_update_time).seconds,

After Change


            counters = psutil.net_io_counters(pernic=True)
            if self.argument in counters:
                counter = counters[self.argument][IO_COUNTER[self.type]]
                now = dt_util.utcnow()
                if self._last_value and self._last_value < counter:
                    self._state = round(
                        (counter - self._last_value)
                        / 1000 ** 2
                        / (now - self._last_update_time).seconds,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: home-assistant/home-assistant
Commit Name: 80136f3591b0580a38ac9ef2babf2f79fd444272
Time: 2019-09-18
Author: ttmost@gmail.com
File Name: homeassistant/components/systemmonitor/sensor.py
Class Name: SystemMonitorSensor
Method Name: update


Project Name: home-assistant/home-assistant
Commit Name: e0ecb64a108db390488ef91b70279ebe42429f80
Time: 2015-04-28
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/helpers/state.py
Class Name: TrackStates
Method Name: __enter__


Project Name: home-assistant/home-assistant
Commit Name: 80136f3591b0580a38ac9ef2babf2f79fd444272
Time: 2019-09-18
Author: ttmost@gmail.com
File Name: homeassistant/components/season/sensor.py
Class Name: Season
Method Name: __init__


Project Name: home-assistant/home-assistant
Commit Name: e0ecb64a108db390488ef91b70279ebe42429f80
Time: 2015-04-28
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/recorder.py
Class Name: Recorder
Method Name: __init__