Beispiel #1
0
 def refreshData(self):
     from core.firefly_api import update_status
     returnData = {}
     for item in self._requests:
         returnData[item] = self._requests[item]()
     returnData['deviceID'] = self._id
     update_status(returnData)
     return returnData
Beispiel #2
0
 def refreshData(self):
   from core.firefly_api import update_status
   returnData = {}
   for item in self._requests:
     returnData[item] = self._requests[item]()
   returnData['deviceID'] = self._id
   update_status(returnData)
   return returnData
Beispiel #3
0
  def refreshData(self):
    logging.debug('Refresh Data in ' + self._name)
    from core.firefly_api import update_status
    returnData = {}
    '''
    allData = dict(self.__dict__)
    if allData.get('COMMANDS'):
      allData.pop('COMMANDS', None)
    if allData.get('REQUESTS'):
      allData.pop('REQUESTS',None)
    if allData.get('_commands'):
      allData.pop('_commands', None)
    if allData.get('_requests'):
      allData.pop('_requests', None)
    logging.critical(allData)
    returnData = allData
    '''
    newChanges = {}
    for item in self._requests:
      returnData[item] = self._requests[item]()
      #This builds a list of only the things that have changed - This way an event can be sent with only those items
      if returnData[item] != self._lastStatus.get(item):
        newChanges[item] = returnData[item]
    self._lastStatus = returnData
    returnData['deviceID'] = self._id
    returnData['views'] = self._views
    updated = update_status(returnData)
    if updated and newChanges != {}:
      return newChanges

    return False
Beispiel #4
0
  def refreshData(self):
    logging.debug('Refresh Data in ' + self._name)
    from core.firefly_api import update_status
    returnData = {}
    '''
    allData = dict(self.__dict__)
    if allData.get('COMMANDS'):
      allData.pop('COMMANDS', None)
    if allData.get('REQUESTS'):
      allData.pop('REQUESTS',None)
    if allData.get('_commands'):
      allData.pop('_commands', None)
    if allData.get('_requests'):
      allData.pop('_requests', None)
    logging.critical(allData)
    returnData = allData
    '''
    newChanges = {}
    for item in self._requests:
      returnData[item] = self._requests[item]()
      #This builds a list of only the things that have changed - This way an event can be sent with only those items
      if returnData[item] != self._lastStatus.get(item):
        newChanges[item] = returnData[item]
    self._lastStatus = returnData
    returnData['deviceID'] = self._id
    returnData['views'] = self._views
    updated = update_status(returnData)
    if updated and newChanges != {}:
      return newChanges

    return False