Add Raspberry Pi device capabilities on v5#35
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79a5ef3fe1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| HEALTH_ARGS+=(--env-file "${ENV_FILE}") | ||
| fi | ||
|
|
||
| "${PYTHON_BIN}" -m endpoint_providers.raspberry_pi.meetyou_rpi_endpoint.health "${HEALTH_ARGS[@]}" |
There was a problem hiding this comment.
Preserve fake-GPIO smoke-test mode
When this script is run in its default local/simulation mode, the new health check exits non-zero before the simulator starts because it does not receive the later --fake-gpio setting and still requires real GPIO/lgpio checks and a token env; with set -e, a developer using the fallback user/rpi_endpoint.example.json on a non-Pi (or without /etc/meetyou/rpi-endpoint.env) never reaches the --simulate --fake-gpio command. Please either pass MEETYOU_RPI_FAKE_GPIO=1/a health simulation mode for this path or make the health check optional for local smoke runs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65e411f8dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| async def _write_logical(device, value: bool, context: CapabilityContext) -> dict[str, Any]: | ||
| backend = _gpio_backend(context) | ||
| pin = _validate_device_pin(device, context) | ||
| return await backend.write(pin, _physical_value(device, value), duration_ms=0) |
There was a problem hiding this comment.
Keep real GPIO outputs open during device writes
On a real Pi using the gpiozero backend, this one-shot _write_logical call returns only after GpioZeroBackend.write() has closed the DigitalOutputDevice, so rpi.device.set releases the pin immediately and pulse/blink sleep after the pin has already been released. The fake backend stores state, so the new tests pass, but the advertised device operations will not reliably hold LEDs/relays active for the requested value or interval on real hardware.
Useful? React with 👍 / 👎.
LuuOW
left a comment
There was a problem hiding this comment.
Technical audit: code patterns and architectural layout verified for system reliability.
Summary
v5.v5Core/gateway/tools/UI main-chain behavior as the base and adapt the Pi provider on top.rpi.device.*,rpi.button.read, Pi diagnostics, and Core routing coverage.Rebase notes
origin/v5with no manual conflicts.v5remains the source of truth for Core/gateway/tools/UI main-chain files.Validation
python -m pytest endpoint_providers/raspberry_pi/tests -q-> 40 passedpython -m pytest tests/test_rpi_core_integration.py tests/test_endpoint_tools.py -q-> 14 passedpython -m pytest tests/test_endpoint_tool_protocol.py tests/test_endpoint_provider_protocols.py tests/test_endpoint_protocol_v4.py tests/test_tool_router_v4.py -q-> 29 passedReal Pi validation carried forward
rpi.device.*andrpi.button.read.registered_capability_count: 10.Security invariants
/client/ws,source_client_id,target_client_id, orClientToolDispatchServicechanges.system.heartbeat.