Skip to content

Feat/adapter revision - #10

Merged
CarlosVasquez04 merged 7 commits into
mainfrom
feat/adapter-revision
Nov 19, 2025
Merged

Feat/adapter revision#10
CarlosVasquez04 merged 7 commits into
mainfrom
feat/adapter-revision

Conversation

@tylerlv3

@tylerlv3 tylerlv3 commented Nov 14, 2025

Copy link
Copy Markdown
Collaborator

Summary

After our first trailer visit we realized that our adapter was not properly set up to interact with the Halio API. So wee have since adjusted how we handle the responses, and make sure we are calling the correct endpoints. Also we switched from authenticating with bearer tokens to x-api-key. This also includes some small updates to README.

Type

  • Feature
  • Fix
  • Docs
  • Chore

Testing

Tested Sim and real mode (without API access). No new behaviors, and tests still pass.

Risk and rollout

No risk, as it already wasn't functioning. If it still isn't, additional revision will be required.

Checklist

  • Issue linked if applicable
  • Added or updated docs
  • CI green
  • At least one reviewer not the author

- Change authentication header from Bearer token to X-API-Key
- Fix response parsing to extract results array from wrapped API responses
- Remove group members lookup (API doesn't provide this field)
- Update window_mapping.json with actual UUIDs from Halio API

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes critical issues with the Halio API adapter discovered during initial trailer testing. The changes update authentication from Bearer tokens to X-API-Key headers, improve response handling for the wrapped API response format, and update configuration with actual Halio window UUIDs and local API endpoint.

Key Changes:

  • Switched authentication from Authorization: Bearer to X-API-Key header
  • Added response wrapper handling to extract results field from API responses
  • Updated window mappings from placeholder UUIDs to actual production UUIDs

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
web/package-lock.json Removed "peer": true flag from React dependency
svc/main.py Added dotenv loading at module initialization to ensure environment variables are available
svc/data/window_mapping.json Updated all panel-to-window UUID mappings with actual production values
svc/data/panels_config.json Modified group assignments and renamed group from "G-1" to "G-2"
svc/data/exampleGroupsResp.json Removed trailing whitespace/characters
svc/app/simulator.py Removed duplicate create_group method definition
svc/app/service.py Removed duplicate create_group method definition
svc/app/config.py Changed default HALIO_API_URL to local trailer endpoint (192.168.2.200:8084)
svc/app/adapter.py Updated authentication method, added response wrapper handling, improved error handling with 206 status code support, and added validation for API responses
README.md Updated file structure documentation and license information
Files not reviewed (1)
  • web/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread svc/app/adapter.py
}
return self._state_cache[window_id]
elif response.status_code == 206:
# No Tint Data - API returns: {"statusCode": 200, "message": "No Tint Data", "success": true}

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states the API returns "statusCode": 200 for the "No Tint Data" case, but the code is checking for response.status_code == 206. This is inconsistent. The comment should be updated to reflect the correct status code (206), or if the API documentation indicates 200, the code should be corrected.

Copilot uses AI. Check for mistakes.
Comment thread svc/app/config.py Outdated
Comment thread svc/app/adapter.py
id=group_id,
name=hg.get("name", f"Group {group_id}"),
member_ids=member_panel_ids,
member_ids=[], # Groups API doesn't provide member windows

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting member_ids=[] for all groups will break the set_group() method (lines 324-331, not shown in diff), which relies on iterating over g.member_ids to update state cache and return affected panels. When member_ids is always empty, set_group() will always return an empty list even when the group tint command is accepted, causing the service to incorrectly report "no panels updated due to dwell time".

If the Halio Groups API truly doesn't provide member information, consider:

  1. Fetching members from a separate API endpoint
  2. Maintaining a local group-to-members mapping
  3. Returning a success indicator without specific panel IDs when members are unknown

Copilot uses AI. Check for mistakes.
tylerlv3 and others added 2 commits November 14, 2025 13:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CarlosVasquez04
CarlosVasquez04 merged commit 26d8325 into main Nov 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants