Customize plugin for personal usage

This commit is contained in:
2021-05-24 10:38:45 +02:00
parent 95bd807cbb
commit 4ecf1d66dc
2 changed files with 75 additions and 40 deletions

View File

@@ -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.")