Skip to content

Commit a9f5eca

Browse files
committed
Updating presence in locations now resets the existing presence first, then adds the current presence.
1 parent 2416ce1 commit a9f5eca

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

crownstone_cloud/lib/cloudModels/locations.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ async def async_update_location_presence(self) -> None:
6161
presence_data = await RequestHandler.get(
6262
'Spheres', 'presentPeople', model_id=self.sphere_id
6363
)
64+
# reset the presence
65+
for location in self.locations.values():
66+
location.present_people = []
67+
# add new presence
6468
for presence in presence_data:
6569
for present_location in presence['locations']:
6670
for location in self.locations.values():

0 commit comments

Comments
 (0)