Currently I do the following:
1) Call the API for each device_id in updatedevicestates which is called in a loop for each device from runConcurrentThread at the frequency chosen in pluginProps
- Code: Select all
def updatedevicestates(self, device):
2) Get every state for that device from Life360 and save it in an array called device_states
- Code: Select all
device_states.append({'key': 'member_first_name','value': m['firstName'] })
3) Update all the device states
- Code: Select all
device.updateStatesOnServer(device_states)
What's the right way to update only the device states that have changed?