mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -80,13 +80,13 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
|
||||
@classmethod
|
||||
def get_plugin_options(cls) -> Dict:
|
||||
return {
|
||||
"power_led_pin": Option(-1, type=valid_gpio_pin),
|
||||
"hdd_led_pin": Option(-1, type=valid_gpio_pin),
|
||||
"power_led_pin": Option(-1, type=valid_gpio_pin),
|
||||
"hdd_led_pin": Option(-1, type=valid_gpio_pin),
|
||||
"power_led_inverted": Option(True, type=valid_bool),
|
||||
"hdd_led_inverted": Option(True, type=valid_bool),
|
||||
|
||||
"power_switch_pin": Option(-1, type=valid_gpio_pin),
|
||||
"reset_switch_pin": Option(-1, type=valid_gpio_pin),
|
||||
"power_switch_pin": Option(-1, type=valid_gpio_pin),
|
||||
"reset_switch_pin": Option(-1, type=valid_gpio_pin),
|
||||
"click_delay": Option(0.1, type=valid_float_f01),
|
||||
"long_click_delay": Option(5.5, type=valid_float_f01),
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ class Plugin(BaseHid):
|
||||
"write_retries_delay": Option(0.1, type=valid_float_f01),
|
||||
},
|
||||
|
||||
"noop": Option(False, type=valid_bool),
|
||||
"state_poll": Option(0.1, type=valid_float_f01),
|
||||
"noop": Option(False, type=valid_bool),
|
||||
"state_poll": Option(0.1, type=valid_float_f01),
|
||||
}
|
||||
|
||||
def start(self) -> None:
|
||||
|
||||
@@ -50,7 +50,7 @@ class Plugin(BaseMsd):
|
||||
return {
|
||||
"storage": Option("/var/lib/kvmd/msd", type=valid_abs_dir, unpack_as="storage_path"),
|
||||
"remount_cmd": Option([*sudo, "/usr/bin/kvmd-helper-otgmsd-remount", "{mode}"], type=valid_command),
|
||||
"unlock_cmd": Option([*sudo, "/usr/bin/kvmd-helper-otgmsd-unlock", "unlock"], type=valid_command),
|
||||
"unlock_cmd": Option([*sudo, "/usr/bin/kvmd-helper-otgmsd-unlock", "unlock"], type=valid_command),
|
||||
}
|
||||
|
||||
def get_state(self) -> Dict:
|
||||
|
||||
@@ -203,10 +203,10 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes
|
||||
"target_pin": Option(-1, type=valid_gpio_pin),
|
||||
"reset_pin": Option(-1, type=valid_gpio_pin),
|
||||
|
||||
"device": Option("", type=valid_abs_path, unpack_as="device_path"),
|
||||
"init_delay": Option(1.0, type=valid_float_f01),
|
||||
"init_retries": Option(5, type=valid_int_f1),
|
||||
"reset_delay": Option(1.0, type=valid_float_f01),
|
||||
"device": Option("", type=valid_abs_path, unpack_as="device_path"),
|
||||
"init_delay": Option(1.0, type=valid_float_f01),
|
||||
"init_retries": Option(5, type=valid_int_f1),
|
||||
"reset_delay": Option(1.0, type=valid_float_f01),
|
||||
}
|
||||
|
||||
def get_state(self) -> Dict:
|
||||
|
||||
Reference in New Issue
Block a user