mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
fix
This commit is contained in:
parent
4e478f968c
commit
5d1228eb9e
@ -105,9 +105,10 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
|
|||||||
return (self.__active == int(pin))
|
return (self.__active == int(pin))
|
||||||
|
|
||||||
async def write(self, pin: str, state: bool) -> None:
|
async def write(self, pin: str, state: bool) -> None:
|
||||||
assert 0 <= pin <= 15
|
channel = int(pin) + 1
|
||||||
|
assert 1 <= channel <= 16
|
||||||
if state:
|
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 self.__update_notifier.notify()
|
||||||
await asyncio.sleep(self.__switch_delay) # Slowdown
|
await asyncio.sleep(self.__switch_delay) # Slowdown
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user