mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 18:11:54 +08:00
soft of by default
This commit is contained in:
@@ -136,20 +136,20 @@ class Atx: # pylint: disable=too-many-instance-attributes
|
||||
|
||||
@_atx_working
|
||||
async def power_off(self) -> bool:
|
||||
if self.get_state()["leds"]["power"]:
|
||||
await self.click_power_long()
|
||||
return True
|
||||
return False
|
||||
|
||||
@_atx_working
|
||||
async def power_off_soft(self) -> bool:
|
||||
if self.get_state()["leds"]["power"]:
|
||||
await self.click_power()
|
||||
return True
|
||||
return False
|
||||
|
||||
@_atx_working
|
||||
async def power_reset(self) -> bool:
|
||||
async def power_off_hard(self) -> bool:
|
||||
if self.get_state()["leds"]["power"]:
|
||||
await self.click_power_long()
|
||||
return True
|
||||
return False
|
||||
|
||||
@_atx_working
|
||||
async def power_reset_hard(self) -> bool:
|
||||
if self.get_state()["leds"]["power"]:
|
||||
await self.click_reset()
|
||||
return True
|
||||
|
||||
@@ -437,8 +437,8 @@ class Server: # pylint: disable=too-many-instance-attributes
|
||||
done = await ({
|
||||
"on": self.__atx.power_on,
|
||||
"off": self.__atx.power_off,
|
||||
"off_soft": self.__atx.power_off_soft,
|
||||
"reset": self.__atx.power_reset,
|
||||
"off_hard": self.__atx.power_off_hard,
|
||||
"reset_hard": self.__atx.power_reset_hard,
|
||||
}[action])()
|
||||
return _json({"action": action, "done": done})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user