You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New: switch lock per relay.minSwitchInterval (e.g. 5s, 10m, at most 24h) refuses a switch within that
time of the last one. The request is answered with HTTP 429, a Retry-After header and {"error": "switching locked for …"}, and the relay stays as it is. The lock applies to every client, the web page
included, and runs from the last switch, so it also holds across a reload or restart. Start states are never
refused. Without minSwitchInterval nothing changes.
Changed: a request for the current state is no switch.PATCH /relays/{name}/on on a relay that is already on
still answers 200, but it no longer updates lastChange and no longer starts the lock; it is also allowed while the
relay is locked. Clients that repeat the current state (e.g. Node-RED on every poll) therefore no longer hide the
real last switch.
API: relays carry lock: {intervalSeconds, remainingSeconds} when minSwitchInterval is set.
Web page: a locked button is disabled and counts down (🔒 Locked · 0:04), the lock is shown below it.
Changelog
Features
ea73381 feat() switch lock per relay (minSwitchInterval)
Error responses are now JSON {"error": "..."} (was a bare string such as "relay not found"). A 500 carries only internal server error; the cause is in the log.
Unknown config keys are an error. Remove jwtSecret and jwtID from webserver: – JWT is no longer supported, authentication is API key only.
Config validation: each relay needs a GPIO between 2 and 27, and no GPIO may be used twice.
env: prod no longer falls back to the embedded development certificate; certFile must exist.
Environment variables are only expanded in the form ${VAR}; a bare $ stays as it is.
New startState per relay (off default, on, last). For last, create /opt/relayhat/data owned by the service user.
SIGHUP keeps the state of relays that stay configured and refuses a broken config instead of exiting. For systemctl reload, add ExecReload=/bin/kill -HUP $MAINPID to the unit.