mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-16 19:30:23 +08:00
configurable maxpower
This commit is contained in:
parent
bfb54767fa
commit
9bd129f70b
@ -382,6 +382,7 @@ def _get_config_scheme() -> Dict:
|
|||||||
"manufacturer": Option("Pi-KVM"),
|
"manufacturer": Option("Pi-KVM"),
|
||||||
"product": Option("Composite KVM Device"),
|
"product": Option("Composite KVM Device"),
|
||||||
"serial": Option("CAFEBABE"),
|
"serial": Option("CAFEBABE"),
|
||||||
|
"max_power": Option(250, type=functools.partial(valid_number, min=0, max=500)),
|
||||||
|
|
||||||
"gadget": Option("kvmd", type=valid_otg_gadget),
|
"gadget": Option("kvmd", type=valid_otg_gadget),
|
||||||
"udc": Option("", type=valid_stripped_string),
|
"udc": Option("", type=valid_stripped_string),
|
||||||
|
|||||||
@ -190,7 +190,7 @@ def _cmd_start(config: Section) -> None:
|
|||||||
_mkdir(config_path)
|
_mkdir(config_path)
|
||||||
_mkdir(join(config_path, "strings/0x409"))
|
_mkdir(join(config_path, "strings/0x409"))
|
||||||
_write(join(config_path, "strings/0x409/configuration"), "Config 1: Pi-KVM device")
|
_write(join(config_path, "strings/0x409/configuration"), "Config 1: Pi-KVM device")
|
||||||
_write(join(config_path, "MaxPower"), "250")
|
_write(join(config_path, "MaxPower"), str(config.otg.max_power))
|
||||||
|
|
||||||
if config.otg.devices.serial.enabled:
|
if config.otg.devices.serial.enabled:
|
||||||
logger.info("===== Required Serial =====")
|
logger.info("===== Required Serial =====")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user