From 3f4b3cd1aa7618ac5eed8bacbdfc19a872dcd1ac Mon Sep 17 00:00:00 2001 From: Gilles MOREL Date: Tue, 15 Jan 2019 23:02:35 +0100 Subject: [PATCH] Correction du style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oublis de la validation précédente --- homesfr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homesfr.py b/homesfr.py index bc71a85..aada1fd 100644 --- a/homesfr.py +++ b/homesfr.py @@ -37,6 +37,7 @@ REMOTE_CONTROLER = 'REMOTE' KEYPAD_CONTROLER = 'KEYPAD' PRESENCE_CAMERA_DETECTOR = 'PIR_CAMERA' + class Common (): ''' Common ressources to the library's classes @@ -142,7 +143,7 @@ class Common (): r = Image.open (f) return (r) - def get_xml_elements (self, url, label, id_label=None): + def get_xml_elements (self, url, label, id_label = None): def build_tree (element): r = {} for i in element.getchildren (): @@ -165,6 +166,7 @@ class Common (): r.update ({i.get (id_label): build_tree (i)}) return (r) + class HomeSFR (Common): def __init__ (self, username = None, password = None, cookies = None, debug = False, autologin = True): ''' @@ -376,6 +378,7 @@ class HomeSFR (Common): a = self.base_url + self.logs_path return (self.get_xml_elements (a, self.logs_labels)) + class Sensor (Common): ''' Class used to read easily the sensors @@ -481,6 +484,7 @@ class Sensor (Common): ''' return (self.sensor_dict [self.sensors_status_field] == self.sensors_status_value_ok) + class Camera (Sensor): ''' Class used to manipulate easily cameras