home-assistant-ecosystem / python-glances-api

Python API for interacting with Glances
MIT License
4 stars 8 forks source link

Fix network RX and TX for Home Assistant (bytes/s) #34

Closed wittypluck closed 6 months ago

wittypluck commented 6 months ago

The aim of this Pull Request is to have correct network data sent to Home Assistant. It is a first step before integrating network sensors into HA.

The correct computation of RX and TX values is described here by the Glances author : https://github.com/nicolargo/glances/issues/1406#issuecomment-456965558 https://github.com/nicolargo/glances/issues/1704#issuecomment-673510389

In Bytes/second : rx in Bps = rx / time_since_update tx in Bps = tx / time_since_update

Linked PR in HA: https://github.com/home-assistant/core/pull/114546