131
131
'NSD' : ["smoke sensor" , 'Home + Security' ],
132
132
'NHC' : ["home coach" , 'Aircare' ],
133
133
'NIS' : ["indoor sirene" , 'Home + Security' ],
134
+ 'NDL' : ["Doorlock" , 'Home + Security' ],
134
135
135
136
'NLC' : ["Cable Outlet" , 'Home+Control' ],
136
137
'NLE' : ["Ecometer" , 'Home+Control' ],
@@ -643,26 +644,24 @@ def __init__(self, authData, home=None):
643
644
resp = postRequest ("Home data" , _GETHOMEDATA_REQ , postParams )
644
645
self .rawData = resp ['body' ]
645
646
# Collect homes
646
- self .homes = { d ['id' ] : d for d in self .rawData ['homes' ] }
647
- # FIXME : Doesn't use the home parameter to select the appropriate home !
648
- for k , v in self .homes .items ():
649
- self .homeid = k
650
- C = v .get ('cameras' )
651
- P = v .get ('persons' )
652
- S = v .get ('smokedetectors' )
647
+ self .homes = self .rawData ['homes' ][0 ]
653
648
for d in self .rawData ['homes' ] :
654
649
if home == d ['name' ]:
655
650
self .homes = d
656
651
else :
657
652
pass
658
653
#
654
+ #print (self.homes.keys())
655
+ #dict_keys(['id', 'name', 'persons', 'place', 'cameras', 'smokedetectors', 'events'])
656
+ self .homeid = self .homes ['id' ]
659
657
C = self .homes ['cameras' ]
660
658
P = self .homes ['persons' ]
661
659
S = self .homes ['smokedetectors' ]
662
660
E = None
663
661
# events not always in self.homes
664
662
if 'events' in self .homes .keys ():
665
663
E = v .get ('events' )
664
+ #
666
665
if not S :
667
666
logger .warning ('No smoke detector found' )
668
667
if not C :
@@ -674,7 +673,7 @@ def __init__(self, authData, home=None):
674
673
# if not (C or P or S or E):
675
674
# raise NoDevice("No device found in home %s" % k)
676
675
if S or C or P or E :
677
- self .default_home = home or list ( self .homes . values ())[ 0 ] ['name' ]
676
+ self .default_home = home or self .homes ['name' ]
678
677
# Split homes data by category
679
678
self .persons = {}
680
679
self .events = {}
@@ -1169,6 +1168,9 @@ def getStationMinMaxTH(station=None, module=None, home=None):
1169
1168
thermostat = ThermostatData (authorization )
1170
1169
Default_relay = thermostat .Relay_Plug ()
1171
1170
Default_thermostat = thermostat .Thermostat_Data ()
1171
+ thermostat .getThermostat ()
1172
+ print (thermostat .moduleNamesList ())
1173
+ #print (thermostat.getModuleByName(name))
1172
1174
except NoDevice :
1173
1175
logger .warning ("No thermostat avaible for testing" )
1174
1176
0 commit comments