Skip to content

Commit

Permalink
Update homecoach lastdata
Browse files Browse the repository at this point in the history
  • Loading branch information
JurgenLB authored Nov 11, 2024
1 parent 9c4f9da commit 49c889d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lnetatmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ def HomecoachDevice(self, id=""):
for device in self.rawData:
if id in device['_id']:
return device
self.HomecoachDevice = device
return None

def Dashboard(self, id=""):
#D = self.HomecoachDevice['dashboard_data']
Expand All @@ -1023,15 +1023,17 @@ def Dashboard(self, id=""):
def lastData(self, hid=None, exclude=0):
for device in self.rawData:
if id == device['_id']:
#s = self.HomecoachDevice['dashboard_data']['time_utc']
# LastData in HomeCoach
#s = self.HomecoachDevice['dashboard_data']['time_utc']
# Define oldest acceptable sensor measure event
limit = (time.time() - exclude) if exclude else 0
ds = self.HomecoachDevice['dashboard_data']
if ds.get('time_utc',limit+10) > limit :
_id = ds[id]
return {'When':ds, '_id':_id}
ds = device['dashboard_data']['time_utc']
if device.get('time_utc',limit+10) > limit :
return {'When': ds, '_id': id}
else:
return {'When': 0, 'id': hid}
else:
return {'When': 0, 'id': id}
pass

def checkNotUpdated(self, res, hid, delay=3600):
ret = []
Expand Down

0 comments on commit 49c889d

Please sign in to comment.