summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-11-12 22:36:22 +0300
committerDevaev Maxim <[email protected]>2020-11-12 22:36:22 +0300
commit180251ec591245ca2025341214e255e3952184d7 (patch)
tree9d7de539934e790f8593080fbd439aa565ef7297 /kvmd
parent87cc8cf7b0e00f7f0a9badf551067aafad6da4ce (diff)
refactoring
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/plugins/atx/gpio.py6
-rw-r--r--kvmd/plugins/hid/_mcu/gpio.py2
-rw-r--r--kvmd/plugins/hid/spi.py2
-rw-r--r--kvmd/plugins/msd/relay.py4
-rw-r--r--kvmd/plugins/ugpio/ezcoo.py2
-rw-r--r--kvmd/plugins/ugpio/gpio.py4
6 files changed, 10 insertions, 10 deletions
diff --git a/kvmd/plugins/atx/gpio.py b/kvmd/plugins/atx/gpio.py
index b1d6d5d9..6d347c85 100644
--- a/kvmd/plugins/atx/gpio.py
+++ b/kvmd/plugins/atx/gpio.py
@@ -78,7 +78,7 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
self.__reader = aiogp.AioReader(
path=env.GPIO_DEVICE_PATH,
- consumer="kvmd::atx-gpio::leds",
+ consumer="kvmd::atx::leds",
pins={
power_led_pin: aiogp.AioReaderPinParams(power_led_inverted, power_led_debounce),
hdd_led_pin: aiogp.AioReaderPinParams(hdd_led_inverted, hdd_led_debounce),
@@ -111,10 +111,10 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
self.__chip = gpiod.Chip(env.GPIO_DEVICE_PATH)
self.__power_switch_line = self.__chip.get_line(self.__power_switch_pin)
- self.__power_switch_line.request("kvmd::atx-gpio::power_switch", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
+ self.__power_switch_line.request("kvmd::atx::power_switch", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
self.__reset_switch_line = self.__chip.get_line(self.__reset_switch_pin)
- self.__reset_switch_line.request("kvmd::atx-gpio::reset_switch", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
+ self.__reset_switch_line.request("kvmd::atx::reset_switch", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
async def get_state(self) -> Dict:
return {
diff --git a/kvmd/plugins/hid/_mcu/gpio.py b/kvmd/plugins/hid/_mcu/gpio.py
index 87f4b547..40031e33 100644
--- a/kvmd/plugins/hid/_mcu/gpio.py
+++ b/kvmd/plugins/hid/_mcu/gpio.py
@@ -54,7 +54,7 @@ class Gpio:
assert self.__reset_line is None
self.__chip = gpiod.Chip(env.GPIO_DEVICE_PATH)
self.__reset_line = self.__chip.get_line(self.__reset_pin)
- self.__reset_line.request("kvmd::hid-mcu::reset", gpiod.LINE_REQ_DIR_OUT, default_vals=[int(self.__reset_inverted)])
+ self.__reset_line.request("kvmd::hid::reset", gpiod.LINE_REQ_DIR_OUT, default_vals=[int(self.__reset_inverted)])
def close(self) -> None:
if self.__chip:
diff --git a/kvmd/plugins/hid/spi.py b/kvmd/plugins/hid/spi.py
index 8af03483..de8d4978 100644
--- a/kvmd/plugins/hid/spi.py
+++ b/kvmd/plugins/hid/spi.py
@@ -147,7 +147,7 @@ class _SpiPhy(BasePhy): # pylint: disable=too-many-instance-attributes
if self.__sw_cs_pin > 0:
with contextlib.closing(gpiod.Chip(env.GPIO_DEVICE_PATH)) as chip:
line = chip.get_line(self.__sw_cs_pin)
- line.request("kvmd::hid-mcu::sw_cs", gpiod.LINE_REQ_DIR_OUT, default_vals=[1])
+ line.request("kvmd::hid::sw_cs", gpiod.LINE_REQ_DIR_OUT, default_vals=[1])
yield line
else:
yield None
diff --git a/kvmd/plugins/msd/relay.py b/kvmd/plugins/msd/relay.py
index e1e21ea9..31ef6176 100644
--- a/kvmd/plugins/msd/relay.py
+++ b/kvmd/plugins/msd/relay.py
@@ -176,10 +176,10 @@ class _Gpio:
self.__chip = gpiod.Chip(env.GPIO_DEVICE_PATH)
self.__target_line = self.__chip.get_line(self.__target_pin)
- self.__target_line.request("kvmd::msd-relay::target", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
+ self.__target_line.request("kvmd::msd::target", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
self.__reset_line = self.__chip.get_line(self.__reset_pin)
- self.__reset_line.request("kvmd::msd-relay::reset", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
+ self.__reset_line.request("kvmd::msd::reset", gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
def close(self) -> None:
if self.__chip:
diff --git a/kvmd/plugins/ugpio/ezcoo.py b/kvmd/plugins/ugpio/ezcoo.py
index 460bce2d..bdc65d36 100644
--- a/kvmd/plugins/ugpio/ezcoo.py
+++ b/kvmd/plugins/ugpio/ezcoo.py
@@ -134,7 +134,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
logger.info("Started %s pid=%d", self, os.getpid())
aioproc.ignore_sigint()
- aioproc.rename_process(f"ugpio-ezcoo-{self._instance_name}")
+ aioproc.rename_process(f"gpio-ezcoo-{self._instance_name}")
while not self.__stop_event.is_set():
try:
diff --git a/kvmd/plugins/ugpio/gpio.py b/kvmd/plugins/ugpio/gpio.py
index 4d50d4fc..d7f390a7 100644
--- a/kvmd/plugins/ugpio/gpio.py
+++ b/kvmd/plugins/ugpio/gpio.py
@@ -60,7 +60,7 @@ class Plugin(BaseUserGpioDriver):
assert self.__reader is None
self.__reader = aiogp.AioReader(
path=env.GPIO_DEVICE_PATH,
- consumer="kvmd::ugpio-gpio::inputs",
+ consumer="kvmd::gpio::inputs",
pins=self.__input_pins,
notifier=self._notifier,
)
@@ -68,7 +68,7 @@ class Plugin(BaseUserGpioDriver):
self.__chip = gpiod.Chip(env.GPIO_DEVICE_PATH)
for (pin, initial) in self.__output_pins.items():
line = self.__chip.get_line(pin)
- line.request("kvmd::ugpio-gpio::outputs", gpiod.LINE_REQ_DIR_OUT, default_vals=[int(initial or False)])
+ line.request("kvmd::gpio::outputs", gpiod.LINE_REQ_DIR_OUT, default_vals=[int(initial or False)])
self.__output_lines[pin] = line
async def run(self) -> None: