api: make relay outputs hardware-profile aware
This commit is contained in:
@@ -183,3 +183,26 @@ Compatibility rule:
|
||||
- The API should support the current 2-channel board while allowing a future 6-output profile without changing dashboard/client assumptions.
|
||||
- Clients should render outputs dynamically from the API response.
|
||||
- Clients should not hardcode relay count.
|
||||
|
||||
## Implemented Output Compatibility Layer
|
||||
|
||||
The Cargo ESP firmware now exposes relay/output state as an output-count-agnostic list.
|
||||
|
||||
The current active hardware profile remains:
|
||||
|
||||
generic_esp32_2ch_relay
|
||||
|
||||
The API includes:
|
||||
|
||||
- `hardware_profile`
|
||||
- `output_count`
|
||||
- `relays[]`
|
||||
- `relays[].role`
|
||||
- `relays[].hardware_channel`
|
||||
- `relays[].hardware_profile`
|
||||
- `relays[].available`
|
||||
- `relays[].state`
|
||||
|
||||
This keeps the current 2-channel relay board working while preparing the API shape for the future LilyGO T-Relay-S3 6-way profile.
|
||||
|
||||
When the LilyGO board arrives, the expected migration should be a hardware profile and relay driver change, not a dashboard/API redesign.
|
||||
|
||||
Reference in New Issue
Block a user