Skip to content

Add remote control support for Airthings Renew devices#46

Merged
michaelahern merged 1 commit intomichaelahern:mainfrom
devdavidkarlsson:remote-control
May 4, 2026
Merged

Add remote control support for Airthings Renew devices#46
michaelahern merged 1 commit intomichaelahern:mainfrom
devdavidkarlsson:remote-control

Conversation

@devdavidkarlsson
Copy link
Copy Markdown
Contributor

Summary

  • Adds RemoteControlMode enum and RemoteControlState interface to schemas
  • Adds getRemoteControl(sn) and setRemoteControl(sn, state) methods to AirthingsClient
  • Extends #handleFetch to support request methods with bodies (PUT)
  • Updates vendor-docs/openapi.yaml with the new Remote Control endpoints
  • Updates example to demonstrate remote control usage

The new endpoints support the Airthings Renew (AP_1) air purifier with modes: OFF, AUTO, SLEEP, BOOST, and MANUAL (with configurable fan speed 1-5).

Test plan

  • Verify getRemoteControl() returns current device state
  • Verify setRemoteControl() sends mode commands successfully
  • Verify MANUAL mode requires fanSpeed parameter
  • Verify error handling for unsupported device types (non-Renew)

🤖 Generated with Claude Code

Adds getRemoteControl() and setRemoteControl() methods to AirthingsClient
for the new /v1/accounts/{accountId}/devices/{sn}/remote-control endpoints.
Supports OFF, AUTO, SLEEP, BOOST, and MANUAL modes with configurable fan speed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class remote control support for Airthings Renew (AP_1) devices to this client library, including schema/types, client methods, and OpenAPI/vendor docs updates.

Changes:

  • Add remote control schemas/types (RemoteControlMode, RemoteControlState) to the public schema exports.
  • Add getRemoteControl(sn) / setRemoteControl(sn, state) to AirthingsClient, and extend internal fetch helper to accept RequestInit (for PUT bodies).
  • Update vendor OpenAPI spec and the example script to demonstrate Renew remote control usage.

Reviewed changes

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

File Description
vendor-docs/openapi.yaml Adds Remote Control GET/PUT endpoints and related request/response schemas/parameters.
src/schemas.ts Introduces Remote Control mode enum and state interface for the new endpoints.
src/client.ts Adds remote control client methods and extends #handleFetch to support PUT requests with JSON bodies.
src/example.ts Demonstrates reading and setting Renew remote control mode.

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

Comment thread src/schemas.ts
Comment thread src/schemas.ts
Comment thread src/client.ts
Comment thread src/example.ts
@michaelahern michaelahern merged commit 9adc610 into michaelahern:main May 4, 2026
8 checks passed
@michaelahern
Copy link
Copy Markdown
Owner

Thanks for the contribution David!

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