From 9039563f6719ba047c4c0e71b8c4d023e5db0feb Mon Sep 17 00:00:00 2001 From: Anna Bocharova Date: Mon, 25 Nov 2024 20:36:02 +0100 Subject: [PATCH 1/3] FIX: querying inactive relay in `update_ui()` (#326) --- octoprint_octorelay/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/octoprint_octorelay/__init__.py b/octoprint_octorelay/__init__.py index 96557684..25d517a3 100755 --- a/octoprint_octorelay/__init__.py +++ b/octoprint_octorelay/__init__.py @@ -313,15 +313,13 @@ def update_ui(self): )) for index in RELAY_INDEXES: active = bool(settings[index]["active"]) - relay = Driver.ensure( - int(settings[index]["relay_pin"] or 0), - bool(settings[index]["inverted_output"]) - ) - relay_state = relay.is_closed() if active else False + pin = int(settings[index]["relay_pin"] or 0) + inverted = bool(settings[index]["inverted_output"]) + relay_state = Driver.ensure(pin, inverted).is_closed() if active else False task = upcoming_tasks[index] self.model[index] = { - "relay_pin": relay.pin, - "inverted_output": relay.inverted, + "relay_pin": pin, + "inverted_output": inverted, "relay_state": relay_state, # bool since v3.1 "label_text": settings[index]["label_text"], "active": active, From 04658c11c1a1056af11287d2f7524866f8f44140 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Mon, 25 Nov 2024 20:46:27 +0100 Subject: [PATCH 2/3] Changelog: 5.1.1. --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d116c0..86277aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Version 5 +### 5.1.1 + +- Fixed a bug on requesting inactive relay state during the UI update: + - OctoRelay v5 used to request 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](https://github.com/christophhagen). + ### 5.1.0 - Fixed compatibility issue with [Physical Button plugin](https://github.com/LuxuSam/PhysicalButton): From 072042feff1669b9c969e5826ae73cbaa175e300 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Mon, 25 Nov 2024 21:08:02 +0100 Subject: [PATCH 3/3] Changelog: minor. --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86277aa3..889756d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ ### 5.1.1 -- Fixed a bug on requesting inactive relay state during the UI update: - - OctoRelay v5 used to request the GPIO pin state of inactive relays which could cause reservation conflicts and - errors such as `lgpio.error: 'GPIO busy'`; +- 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](https://github.com/christophhagen). ### 5.1.0