Skip to content

Commit

Permalink
cleaner iterate over stations when getting module data
Browse files Browse the repository at this point in the history
  • Loading branch information
heinemml committed Dec 6, 2015
1 parent b7acc94 commit f3470b8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lnetatmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ def __init__(self, authData):
self.rawData = resp['body']
self.stations = { d['_id'] : d for d in self.rawData['devices'] }
self.modules = list()
for index in range(len(self.stations)):
self.modules.append({ m['_id'] : m for m in self.rawData['devices'][index]['modules'] })

for station, data in self.stations.iteritems():
self.modules.append({ m['_id'] : m for m in data['modules'] })

self.default_station = list(self.stations.values())[0]['station_name']

Expand Down

0 comments on commit f3470b8

Please # to comment.