Skip to content

Commit

Permalink
Merge pull request #248 from PawprintPrototyping/rechner/spaceapi_sch…
Browse files Browse the repository at this point in the history
…ema_fix

SpaceAPI follows schema for sensor values
  • Loading branch information
jabelone authored Apr 8, 2024
2 parents feb67d5 + 47e6c6c commit 3dd82bc
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 3dd82bc

Please sign in to comment.