kbr / fritzconnection

Python-Tool to communicate with the AVM Fritz!Box by the TR-064 protocol and the AHA-HTTP-Interface
MIT License
303 stars 59 forks source link

Inconsistency between bytes_sent and bytes_received in FritzStatus #110

Closed Chris-Tophski closed 2 years ago

Chris-Tophski commented 2 years ago

I cannot query FritzStatus.bytes_sent for my FritzBox 7360, but FritzStatus.bytes_received works. So I checked the code for these properties and saw they were differing: While there is a workaround for older devices in bytes_received, this workaround is not implemented bytes_sent. I tried to adapt bytes_sent to bytes_received and this works for me. Not sure, though, if this would interfere with newer devices or if there is another reason why this is not implemented as such. Please have a look.

The actual Error is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/fritzconnection/lib/fritzstatus.py", line 108, in bytes_sent
    return _integer_or_original(status["NewX_AVM_DE_TotalBytesSent64"])
KeyError: 'NewX_AVM_DE_TotalBytesSent64'
kbr commented 2 years ago

Seems you found a bug. Thank you for reporting.