Skip to content

Commit

Permalink
Update spaceapi sensors to match schema
Browse files Browse the repository at this point in the history
Pre-commit
  • Loading branch information
rechner committed Feb 27, 2024
1 parent 1a8a373 commit 68c556c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions memberportal/api_spacedirectory/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get(self, request):
## Setup the basic details
sensor_details = {
"name": sensor.name,
"description": sensor.description,
"description": sensor.description or "",
"location": sensor.location,
}

Expand All @@ -83,11 +83,11 @@ def get(self, request):
signout_date=None
).order_by("-signin_date")

sensor_data["total_member_count"] = {"value": spaceapi_user_count}
sensor_data["total_member_count"] = [{"value": spaceapi_user_count}]

sensor_data["people_now_present"] = {
"value": spaceapi_members_on_site.count()
}
sensor_data["people_now_present"] = [
{"value": spaceapi_members_on_site.count()}
]

# Is the camera array empty? If not, add them
if not config.SPACE_DIRECTORY_CAMS:
Expand Down

0 comments on commit 68c556c

Please sign in to comment.