mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
lint fix
This commit is contained in:
parent
627f7821ef
commit
0e42e10c29
@ -202,7 +202,7 @@ async def wait_infinite() -> None:
|
||||
await asyncio.sleep(3600)
|
||||
|
||||
|
||||
async def wait_first(*aws: (asyncio.Future | asyncio.Task)) -> tuple[set[asyncio.Task], set[asyncio.Task]]:
|
||||
async def wait_first(*aws: asyncio.Task) -> tuple[set[asyncio.Task], set[asyncio.Task]]:
|
||||
return (await asyncio.wait(list(aws), return_when=asyncio.FIRST_COMPLETED))
|
||||
|
||||
|
||||
|
||||
@ -63,16 +63,16 @@ class ExportApi:
|
||||
])
|
||||
rows: list[str] = []
|
||||
|
||||
self.__append_prometheus_rows(rows, atx_state["enabled"], "pikvm_atx_enabled")
|
||||
self.__append_prometheus_rows(rows, atx_state["leds"]["power"], "pikvm_atx_power")
|
||||
self.__append_prometheus_rows(rows, atx_state["enabled"], "pikvm_atx_enabled") # type: ignore
|
||||
self.__append_prometheus_rows(rows, atx_state["leds"]["power"], "pikvm_atx_power") # type: ignore
|
||||
|
||||
for mode in sorted(UserGpioModes.ALL):
|
||||
for (channel, ch_state) in gpio_state[f"{mode}s"].items():
|
||||
for (channel, ch_state) in gpio_state[f"{mode}s"].items(): # type: ignore
|
||||
if not channel.startswith("__"): # Hide special GPIOs
|
||||
for key in ["online", "state"]:
|
||||
self.__append_prometheus_rows(rows, ch_state["state"], f"pikvm_gpio_{mode}_{key}_{channel}")
|
||||
|
||||
self.__append_prometheus_rows(rows, hw_state["health"], "pikvm_hw")
|
||||
self.__append_prometheus_rows(rows, hw_state["health"], "pikvm_hw") # type: ignore
|
||||
self.__append_prometheus_rows(rows, fan_state, "pikvm_fan")
|
||||
|
||||
return "\n".join(rows)
|
||||
|
||||
@ -93,7 +93,7 @@ class RedfishApi:
|
||||
self.__info_manager.get_submanager("meta").get_state(),
|
||||
])
|
||||
try:
|
||||
host = meta_state.get("server", {})["host"]
|
||||
host = str(meta_state.get("server", {})["host"]) # type: ignore
|
||||
except Exception:
|
||||
host = ""
|
||||
return make_json_response({
|
||||
@ -107,7 +107,7 @@ class RedfishApi:
|
||||
},
|
||||
"Id": "0",
|
||||
"HostName": host,
|
||||
"PowerState": ("On" if atx_state["leds"]["power"] else "Off"),
|
||||
"PowerState": ("On" if atx_state["leds"]["power"] else "Off"), # type: ignore
|
||||
}, wrap_result=False)
|
||||
|
||||
@exposed_http("POST", "/redfish/v1/Systems/0/Actions/ComputerSystem.Reset")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user