power: improves GPIO initial_state handling
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
This commit is contained in:
1 parent
7ff126a56e
commit
a3ba4b4169
1 file changed
+4
-2
@@ -478,10 +478,12 @@ class GpioDevice(PowerDevice):
|
||||
if invert:
|
||||
self.line.request(
|
||||
consumer="moonraker", type=gpiod.LINE_REQ_DIR_OUT,
|
||||
flags=gpiod.LINE_REQ_FLAG_ACTIVE_LOW)
|
||||
flags=gpiod.LINE_REQ_FLAG_ACTIVE_LOW,
|
||||
default_val=int(self.initial_state))
|
||||
else:
|
||||
self.line.request(
|
||||
consumer="moonraker", type=gpiod.LINE_REQ_DIR_OUT)
|
||||
consumer="moonraker", type=gpiod.LINE_REQ_DIR_OUT,
|
||||
default_val=int(self.initial_state))
|
||||
except Exception:
|
||||
self.state = "error"
|
||||
logging.exception(
|
||||
|
||||
Reference in new issue
Block a user