Customize plugin for personal usage
This commit is contained in:
20
freebox.py
20
freebox.py
@@ -167,6 +167,24 @@ class FbxApp(FbxCnx):
|
||||
1 #on ne fait rien, on retourne une liste vide
|
||||
return retour
|
||||
|
||||
def xdslinfo(self):
|
||||
retour = {}
|
||||
try:
|
||||
sys = self.com( "connection/xdsl/")
|
||||
retour.update({str('Connexion Uptime'):str(sys["result"]["status"]["uptime"])})
|
||||
retour.update({str('Atténuation Down'):str(sys["result"]["down"]["attn_10"]/10)})
|
||||
retour.update({str('Marge de bruit Down'):str(sys["result"]["down"]["snr_10"]/10)})
|
||||
retour.update({str('Débit Down'):str("%.3f"%(float(sys["result"]["down"]["maxrate"])/1024))})
|
||||
retour.update({str('Attenuation Up'):str(sys["result"]["up"]["attn_10"]/10)})
|
||||
retour.update({str('Marge de bruit Up'):str(sys["result"]["up"]["snr_10"]/10)})
|
||||
retour.update({str('Débit Up'):str("%.3f"%(float(sys["result"]["up"]["maxrate"])/1024))})
|
||||
except (urllib.error.HTTPError, urllib.error.URLError) as error:
|
||||
Domoticz.Log('La Freebox semble indisponible : '+ error.msg)
|
||||
except timeout:
|
||||
1 #on ne fait rien, on retourne une liste vide
|
||||
return retour
|
||||
|
||||
|
||||
def sysinfo(self):
|
||||
retour = {}
|
||||
try:
|
||||
@@ -235,4 +253,4 @@ class FbxApp(FbxCnx):
|
||||
v_result = self.com( "system/reboot")
|
||||
if not v_result['success']:
|
||||
Domoticz.Log("Erreur lors du Reboot")
|
||||
Domoticz.Log("Freebox Server en cours de reboot.")
|
||||
Domoticz.Log("Freebox Server en cours de reboot.")
|
||||
|
||||
Reference in New Issue
Block a user