- Fixed a bug on requesting the state of inactive relays during the UI update:
- OctoRelay v5 queried the GPIO pin state of inactive relays which could cause reservation conflicts and errors
such as
lgpio.error: 'GPIO busy'
; - The issue was found and reported by Christoph Hagen.
- OctoRelay v5 queried the GPIO pin state of inactive relays which could cause reservation conflicts and errors
such as
- Fixed compatibility issue with Physical Button plugin:
- OctoRelay v5 uses a new driver having exclusive pin reservation, so that two plugins could not operate same pin;
- This version releases the reservation immediately, enabling relay operation both using the UI and a physical button.
- Performance improvement for the countdown (remaining time formatting function):
- Attempting to fix user defined locale (
it_IT —> it-IT
) in order to preserve translations; - Looking up for a suitable locale only once per time unit (memoization);
- This should make the countdown about 47 times more efficient.
- Attempting to fix user defined locale (
- Fixed issue with incorrect locale format causing countdown failure and disability to cancel upcoming relay switch:
- The issue reported by Mattia Vidoni;
- The correct locale format is described here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument;
- When locale has invalid format or unsupported by the browser, the default one will be used.
- Initial state for relays is
OFF
— fixes excessive switches on startup in most cases.
- Preventing installations on environments having unsupported Python versions:
- Add Python 3.9 into the plugin setup conditions.
- Upgraded all dependencies;
- Breaking changes:
- Minimum version of Python supported: 3.9;
- Feature: Supporting Raspberry Pi 5:
- Using
gpiozero
withlgpio
orRPi.GPIO
depending on your hardware; - The feature implemented by Mattia Vidoni.
- Using
- How to migrate:
- Ensure having Python version 3.9 or higher;
- If you can not upgrade Python to at least 3.9 — continue using version 4.
- Technical update:
- Reduced number of dependencies;
- Upgraded testing framework;
- Removed a redundant statement.
- Supporting OctoPrint 1.10 and Python 3.12.
- New feature: target for GCODE command (at-command):
- You can now switch the relay to the desired state;
@OCTORELAY r1 ON
— to switch the first relay on;@OCTORELAY r1 OFF
— to switch the first relay off;@OCTORELAY r1
— to toggle the first relay.
- Technical update: no new features, no fixes.
- Breaking changes:
- Plugin API v1 removed.
- How to migrate confidently:
- If you're not using the plugin API or mobile applications that use the plugin API:
- No action required.
- Read the release notes for version 3.14.0 (below) to inform yourself on differences between API v1 and v2.
- If you're using API v1:
- Make sure you're using OctoRelay version 3.14.0 or upgrade to that version first,
- Rename
pin
parameter in your request payload tosubject
, - Add
version: 2
orv: 2
parameter to all your API requests, - Expect to receive a response having HTTP status code
200
and handle others as failures, - In response to
listAllStatus
command expect to receivestatus
(boolean) instead ofactive
, - In response to
update
command expect to receive booleanstatus
instead of "ok" string, - In response to
cancelTask
command expect to receivecancelled
(boolean) instead ofstatus
, - Test all your API requests before upgrading.
- If you're using OctoPod, iOS/tvOS/watchOS App:
- Upgrade it to at least 3.27 — this version supports the plugin API v2 (and v1 too).
- After upgrading to this version:
- You can remove
version
orv
argument from the request payload (no longer needed).
- You can remove
- If you're not using the plugin API or mobile applications that use the plugin API:
- Other improvements:
- UI: Upgraded all dependencies.
- UI: Generating CSS from SCSS.
- Using
mypy
for type constraints. - Introducing the plugin API v2.
- This feature aims to establish consistency and improve clarity across inputs and responses of the plugin API.
- This feature is opt-in until the next major release of the plugin.
- Developers and other API users are advised to migrate to the new API.
- Introducing the
version
and its shorthandv
parameter of each API request payload (integer).- When the parameter is ommitted, the API falls back to v1 (previous behaviour and responses).
- When the parameter is set to
2
, the new request payload is expected and the API responds differently.
- Main differences of v2:
- For
update
andgetStatus
commandspin
parameter is renamed tosubject
. - For
listAllStatus
commandactive
property renamed tostatus
. - For
getStatus
command on disabled relay the API responds with an HTTP code400
instead ofstatus: false
. - For
update
andcancelTask
commands there is no morestatus: "ok" | "error"
:- The
status
now always means the relay state (boolean), while errors are reported via HTTP codes.
- The
- For
- Check out the updated Readme for new examples.
Command | v1 request parameters | v2 request parameter |
---|---|---|
update | pin, target |
subject, target |
getStatus | pin |
subject |
listAllStatus | None | None |
cancelTask | subject, target, owner |
subject, target, owner |
Command | v1 response | v2 response |
---|---|---|
update | result: bool, status: ok |
status: bool |
getStatus | status |
status |
listAllStatus | [active, id, name] |
[status, id, name] |
cancelTask | status: ok |
cancelled: bool |
- Feature: the API command
update
now accepts the optionaltarget
parameter.- Check out the updated documentation in Readme for the request samples and more details.
- Thanks to @patrickcollins12 for that contribution.
- UI source code splitting.
- Making the code easier to test and to maintain.
- Removing the stub
js
file from the sources.- The plugin should only be installed from the distributed release file (not from the sources).
- Changing the UI compiler from
tsc
totsup
(based onesbuild
androllup
). - Extracting the types into the dedicated files.
- UI improvement: better handling of multiple upcoming switches.
- No overlapping popovers: single popover for all upcoming events instead.
- Sorted by the time left.
- Assigned to the relay having the closest switching.
- New feature: AutoConnect delay setting.
- Only visible for a Printer Relay (another setting).
- Only functional for OctoPrint 1.9.0+.
- Renamed setting: "Confirm turning OFF".
- Fixed issue found and reported by @CrNMGuy.
- When printing started should cancel a postponed switch caused by Printing Stopped event.
- A small performance improvement.
- When handling the events causing the relay switches, now triggering the UI update only once for them all after processing their new state.
- New setting: "This is printer relay".
- Ability to specify the relay that controls your printer.
- Thus, the plugin can distinguish the printer relay among other ones.
- The migration script will set this setting to
r2
if you didn't change the second relay labelPrinter
(default). - You may quite reasonably wonder why this is needed:
- New feature: AutoDisconnect.
- Disconnects from the printer before turning its relay off (according to the new setting).
- This helps to shut down the printer a bit more gracefully.
- It prevents an error state like
SerialException
when turning printer off.
- A small improvement to the AutoConnect feature in this regard.
- Now connects automatically only when there are some ports available.
- This also prevents the failures to AutoConnect and attempts to reconnect after turning the printer relay off.
- Fixed a bug: the popover on upcoming relay switch could not appear in some cases.
- In case a postponed switch is configured for PRINTING_STARTED or PRINTING_STOPPED event, but no switch is configured to happen immediately, the UI did not have an update.
- Thanks to @backupartist for reporting and elaborating to fix this issue.
- A couple fixes for the upcoming switch popover:
- The outside clicks handler is removed, so dismissing the popover is now only possible by clicking the Close button.
- Restoring the regular tooltip after dismissing the popover.
- Improved logging:
- fewer messages on
info
level, - more messages on
debug
level.
- fewer messages on
- Introducing the new event: After Turned ON.
- By setting the option to
OFF
with a certain delay, now it has become possible to turn on something for a limited time, not related to printing.
- By setting the option to
- This update prohibits switching of disabled relays.
- Fixed a bug: the disabled relays were still requested on their pin states.
- Introducing the ability to cancel the upcoming automated switch.
- In case of a configured relay switching delay, the corresponding control button will notify about this in a popover.
- The popover shows the upcoming state and the countdown.
- The popover offers a Cancel button to dismiss the pending task.
- This feature is opt-out and can be disabled in the plugin settings.
- New relay setting: "Alert on switches ahead".
- Tooltips for control buttons.
- A couple more improvements for the UI/UX.
- This version introduces a new asset — CSS file.
- New feature: event-based automation.
- In the new UI you can now specify the desired relay state for three events:
- on Startup,
- on Printing Started
- on Printing Stopped.
- Relay switching actions can also be skipped or postponed.
- In particular, it enables you to turn something ON after printing, which was not possible before.
- In the new UI you can now specify the desired relay state for three events:
- This update will migrate the relay settings in existing configuration.
- New UI offers radio buttons instead of checkboxes and distributes the relay settings across tabs.
Before | After | Type |
---|---|---|
initial_value |
rules.STARTUP.state |
bool or None |
auto_on_before_print |
rules.PRINTING_STARTED.state |
bool or None |
auto_off_after_print |
rules.PRINTING_STOPPED.state |
bool or None |
auto_off_delay |
rules.PRINTING_STOPPED.delay |
int |
- Refactoring: using
merged=True
option for consistent retrieval of the relay settings.
- Refactoring: consistent naming for the plugin settings.
- This update will migrate the relay settings in existing configuration.
Before | After |
---|---|
labelText |
label_text |
cmdON |
cmd_on |
cmdOFF |
cmd_off |
autoONforPrint |
auto_on_before_print |
autoOFFforPrint |
auto_off_after_print |
autoOffDelay |
auto_off_delay |
iconOn |
icon_on |
iconOff |
icon_off |
confirmOff |
confirm_off |
- New feature: AutoConnect.
- After turning the printer relay ON the plugin will initiate the connection to printer automatically.
- The feature is only available to users of OctoPrint starting version 1.9.0.
- A minor technical refactoring.
- Using relative imports in the plugin class file.
- This release fixes a UX bug for new installations found and reported by @kds69.
- When installing the plugin first time, first 4 relays used to be activated by default having sample configuration.
- From now on all relays are deactivated by default to prevent unexpected side effects.
- For existing installations this release introduces a new feature — the plugin settings migration.
- This update will migrate the existing plugin settings and preserve the activity state of the fist 4 relays.
- Changed the payload produced by
update_ui()
method:active
— typechanged to(int)
(bool)
.
- Operating GPIO and obtaining relay state was extracted into the Relay driver.
- Executing OS commands was extracted into a dedicated method.
- Moved tests out of the distribution.
- Changed the payload produced by
update_ui()
:— the pin state, removedstate (int)
inverted_output (bool)
— addedrelay_state (bool)
— added.
- Fixed issue on partial saving of the plugin settings.
- Refactoring: enforcing code style for Python using
pylint
. - Testing and clarifying the actual plugin compatibility with OctoPrint.
- Minimum supported version of OctoPrint is 1.5.3.
- Breaking changes
- Changing the release type to a distributable package.
- Plugin version is now set automatically from a GitHub release using
miniver
. - A workflow creates a package and then attaches it to the release assets.
- Thus, redundant files are removed from the distribution.
- The latest release distribution URL has changed to
https://github.com/borisbu/OctoRelay/releases/latest/download/release.zip
- Once you upgrade the plugin from v2 or v1 you will see that the control buttons are gone.
- Instead, there will be a warning button
⚠️ having instructions on further steps:- Don't panic.
- Please proceed to "Software update" section of the OctoPrint settings.
- Find the OctoRelay plugin showing
Installed: unknown
— this is expected. - There also should be a button to UPDATE the plugin one more time.
- After that the plugin will be updated from the new distribution URL and the control buttons appear again.
- Sorry for the inconvenience.
- In case there is no button to update, use the "Force check for updates" function on the top.
- As a last resort you can always use the URL mentioned above to reinstall the plugin manually.
- Hotfix: partial revert of changes from version 2.2.2.
- On some OctoPrint installations the values of plugin settings did not appear.
- It has been experimentally established that restoring the templates array as an inline return might fix this issue.
- Fixed UI/UX bug.
- Hover state made responsive, similar to native OctoPrint buttons.
- Emoji-based buttons are enlarged slightly in order to align with image-based ones.
- Buttons alignment and consistency improved:
- Each button is now
40x40px
, - Each emoji on the button is now
1.25rem
which is20px
, - Each image on the button is expected to be
24x24px
.
- Each button is now
- Refactoring.
- Using
f"string"
syntax instead of"".format()
. - Strict handling of booleans.
- Using
- Another technical update.
- Simplified iteration through relay settings and eliminated some redundant method calls.
- Technical update: no fixes or new features.
- Adaptation of a method for possible future changes.
- Minor refactoring.
- Thanks to @jneilliii's contribution, the plugin supports GCODE command
@OCTORELAY
.- The command toggles the relay by its index specified in parameters.
- Currently supported indexes are from
r1
tor8
. - Example:
@OCTORELAY r4
. - Documentation on
@
commands: https://docs.octoprint.org/en/master/features/atcommands.html
- This version contains an important security fix:
- Read only users are prohibited from switching the relays.
- Thanks to @plazarch for reporting the important security flaw.
- This version introduces a custom permission: "Relay switching".
- The following groups are granted that permission by default: admins and users (operators).
- You can allow relay switching to other ones in "Access control" section of OctoPrint settings.
- Fixed missing requirement on the
pin
parameter for API commandsupdate
andgetStatus
.- Thanks to @jneilliii for the contribution.
- Fixed turning non-inverted relays ON and executing the corresponding optional OS Command when start printing.
- Fixed incorrect description of OS Command setting in the documentation.
- Plugin executable code now has
99%
test coverage.- All following contributions, features and fixes should take this into account.
- Breaking changes
- Minimal Python version required:
3.7
. - Minimal JavaScript version support required:
ES6
(aka ES2015).- Minimal browser versions supporting ES6 are listed here.
- The distributed PNG icons are replaced with SVG ones.
- In case you've been using them in your configuration (
Icon ON/OFF
), you need to change their filenames:3d-printer.png
–>3d-printer.svg
,fan-24.png
–>fan.svg
,webcam.png
–>webcam.svg
.
refresh.png
icon is removed from the distribution.
- In case you've been using them in your configuration (
- Minimal Python version required:
- Fixed
height
property of the icons in the initial config.
- Fixed issue with turning relays ON when start printing.
- JS: Types constraints and tests.
- Moving JS from template.
- Plugin description update.
- Making a pre-release channel.
- Updating the documentation.
- Add API command to get all the states at once.
- Add API command to get pin status
{'pin': 'r1', 'command': 'getStatus'}
. - Poll GPIO to update the UI if the state changes in the background.
- Optional confirmation dialog when turning OFF.
- Auto ON/OFF on start and finish of the print job.
- Auto OFF delay for a fan, that should run longer after the print finished.
- Turn relays on and off.
- Changing icon.
- Power ON on boot.