Erreur si aucun module
This commit is contained in:
@@ -44,15 +44,16 @@ class iDiamant():
|
|||||||
jsonStatus = json.loads(response.text)
|
jsonStatus = json.loads(response.text)
|
||||||
homes = jsonStatus['body']['homes']
|
homes = jsonStatus['body']['homes']
|
||||||
for home in homes:
|
for home in homes:
|
||||||
home_id = home['id']
|
if 'modules' in home:
|
||||||
modules = home['modules']
|
home_id = home['id']
|
||||||
for module in modules:
|
modules = home['modules']
|
||||||
if "NBR" == module['type']:
|
for module in modules:
|
||||||
iDiamant.volets[module['id']] = {
|
if "NBR" == module['type']:
|
||||||
'name':module['name'],
|
iDiamant.volets[module['id']] = {
|
||||||
'bridge':module['bridge'],
|
'name':module['name'],
|
||||||
'id_home':home_id
|
'bridge':module['bridge'],
|
||||||
}
|
'id_home':home_id
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user