From d5c2ae961a664f9987cb917370073cae9c98cfc3 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 23 Dec 2019 18:40:39 +0100 Subject: [PATCH] Reset the mode if GPIO.getmode() returns None for any reason --- platypush/plugins/gpio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/gpio/__init__.py b/platypush/plugins/gpio/__init__.py index 177041a99c..d1d6bfe540 100644 --- a/platypush/plugins/gpio/__init__.py +++ b/platypush/plugins/gpio/__init__.py @@ -46,7 +46,7 @@ class GpioPlugin(Plugin): import RPi.GPIO as GPIO with self._init_lock: - if self._initialized: + if self._initialized or GPIO.getmode(): return GPIO.setmode(self.mode)