Repository navigation
App API for HivePal: hive links, relay status, remote AP mode, export and range delete - #199
Merged
Merged
Conversation
…elete for HivePal
- channels: accept and return per-hive names and HivePal hive ids
(hive_ids, migration 031) so a slot stays linked to its HivePal hive
across renames; GET /app/devices carries both maps
- firmware/status: include hiveinside/beecounter latest versions and the
per-slot relay status the local dashboard already shows
- POST /app/devices/{id}/provisioning/start (remote setup AP)
- GET /app/devices/{id}/export/measurements[/summary] (NDJSON backup)
- POST /app/devices/{id}/measurements/delete (owner, claim-code gated)
- mock server: names/hive_ids, relay status, provisioning, in-memory
inspections, empty recordings; relays accept slots 1..18
- docs: new endpoints, 18-hive limits, correct insights route
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V4BwZGxKox5nD1Nw8fP9NL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4BwZGxKox5nD1Nw8fP9NL
HivePal forwards Authorization: Bearer <jwt>, which the mock rejected (it only read X-User-Id), so HivePal could not run against it at all. The token's sub is used (verified when HIVEPAL_JWT_SECRET is set); X-User-Id still works for curl. Measurements now thin to max_points like the real server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4BwZGxKox5nD1Nw8fP9NL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4BwZGxKox5nD1Nw8fP9NL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the server-side pieces HivePal needs to catch up with the dashboard. The HivePal counterpart is MacNite/hive-pal#38.
Version: the server goes 0.5.3 → 0.6.0 (new app endpoints plus a migration). HivePal's docs name 0.6.0 as the minimum for these features. The firmware is unchanged and stays at 0.30.5.
Server (
/api/v1/app/*)hive_ids("1".."18"→ HivePal hive id) next tonames.031_device_channel_hive_links.sql, mirrored ininit_db.GET /app/devicescarries both maps.""ornullclears a link; names keep their existing semantics.hiveinside_latest_version,hiveinside_relays,beecounter_latest_versionandbeecounter_relays, the same data as the local dashboard.POST /app/devices/{id}/provisioning/start(owner/admin) opens the setup access point remotely.GET /app/devices/{id}/export/measurementsand/export/measurements/summary(owner/admin) give an NDJSON backup of one device.POST /app/devices/{id}/measurements/delete(owner only) deletes a range of readings, gated by the claim code.Mock server
Authorization: Bearer <jwt>. Before this, it only readX-User-Id, so HivePal could not run against it at all. The token is verified whenHIVEPAL_JWT_SECRETis set.max_points.names/hive_ids, relay status, provisioning, in-memory inspections matching the real response shapes, an empty recordings list, and relay slots 1..18.Docs
docs/api.md: the new endpoints, and the 16 → 18 hive limits.docs/insights.md: corrected the insights route.Testing
test-data/test_channel_links.py(pytest), added to CI. It passes together withtest_relay_ota_gate.py.🤖 Generated with Claude Code
https://claude.ai/code/session_01V4BwZGxKox5nD1Nw8fP9NL