summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-09-08 06:04:52 +0300
committerMaxim Devaev <[email protected]>2021-09-08 06:04:52 +0300
commit5d1228eb9e5b159d0909453ed85280b9fb794a9e (patch)
tree79d35e94185f993918a125812fe679c279cbe96a /kvmd/plugins
parent4e478f968c20286bed80fbb579a90ed2e88e6824 (diff)
fix
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/ugpio/tesmart.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/plugins/ugpio/tesmart.py b/kvmd/plugins/ugpio/tesmart.py
index 27cf0038..4bb2351b 100644
--- a/kvmd/plugins/ugpio/tesmart.py
+++ b/kvmd/plugins/ugpio/tesmart.py
@@ -105,9 +105,10 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
return (self.__active == int(pin))
async def write(self, pin: str, state: bool) -> None:
- assert 0 <= pin <= 15
+ channel = int(pin) + 1
+ assert 1 <= channel <= 16
if state:
- await self.__send_command("{:c}{:c}".format(1, int(pin) + 1).encode())
+ await self.__send_command("{:c}{:c}".format(1, channel).encode())
await self.__update_notifier.notify()
await asyncio.sleep(self.__switch_delay) # Slowdown