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

Add wan_uptime, device_uptime and deprecate uptime #104

Closed chemelli74 closed 2 years ago

chemelli74 commented 2 years ago
kbr commented 2 years ago

Thank you for your PR. Having the property device_uptime I see the point to have also a wan_uptime property, but would prefer to set it just as an alias for uptime.

    @property
    def wan_uptime(self):
        """
        WAN uptime in seconds. 
        Alias for self.uptime with more specific name.
        """
        return self.uptime
chemelli74 commented 2 years ago

May be the other ay around: uptime as an alias of wan_uptime ? So in future you can remote uptime ?

Simone

kbr commented 2 years ago

That's what has come first into my mind too. But self.uptime gets called from several other places and there is not really a need to deprecate it. So adding wan_uptime as an alias is less work and less error prone.

chemelli74 commented 2 years ago

I suppose connection_uptime as an alias for uptime (without deprecation) is a better name in combination with device_uptime. Would you like to adapt the code for merging?

Done ;-)

Simone

chemelli74 commented 2 years ago

Thank you. There is a tiny error: as connection_uptime is a property it should not get called as a function from uptime.

Indeed, that's correct; did the change on the fly and introduced that tiny error.

Simone

chemelli74 commented 2 years ago

Do you mind releasing a new version ? Thx in advance

Simone