zachcheatham / ha-omada

Home Assistant TP-Link Omada Integration
186 stars 26 forks source link

Fix gateway rx_rate and tx_rate #101

Closed h3llrais3r closed 2 months ago

h3llrais3r commented 2 months ago

The gateway rx_rate and tx_rate is not (longer) available via the /devices api endpoint details. Instead, we have to call / device/gateways/ api endpoint to get the gateway details. From these details, we get the portStats for the WAN port and get the rxRate and txRate values to populate the rx_rate and tx_rate values. So rx_rate and tx_rate of the gateway represents the internet WAN download/upload speed. Fixes https://github.com/zachcheatham/ha-omada/issues/92

Replaces https://github.com/zachcheatham/ha-omada/pull/99