removed processing flag

This commit is contained in:
Devaev Maxim
2020-09-10 04:48:19 +03:00
parent 015baee6d7
commit 31fdcd2f3c
4 changed files with 13 additions and 25 deletions

View File

@@ -59,16 +59,16 @@ class BaseAtx(BasePlugin):
# =====
async def power_on(self, wait: bool) -> bool:
async def power_on(self, wait: bool) -> None:
raise NotImplementedError
async def power_off(self, wait: bool) -> bool:
async def power_off(self, wait: bool) -> None:
raise NotImplementedError
async def power_off_hard(self, wait: bool) -> bool:
async def power_off_hard(self, wait: bool) -> None:
raise NotImplementedError
async def power_reset_hard(self, wait: bool) -> bool:
async def power_reset_hard(self, wait: bool) -> None:
raise NotImplementedError
# =====

View File

@@ -54,12 +54,8 @@ class Plugin(BaseAtx):
# =====
async def __stub_power(self, wait: bool) -> bool:
async def __stub(self, wait: bool) -> None:
raise AtxDisabledError()
power_on = power_off = power_off_hard = power_reset_hard = __stub_power
async def __stub_click(self, wait: bool) -> None:
raise AtxDisabledError()
click_power = click_power_long = click_reset = __stub_click
power_on = power_off = power_off_hard = power_reset_hard = __stub
click_power = click_power_long = click_reset = __stub

View File

@@ -130,29 +130,21 @@ class Plugin(BaseAtx): # pylint: disable=too-many-instance-attributes
# =====
async def power_on(self, wait: bool) -> bool:
async def power_on(self, wait: bool) -> None:
if not (await self.__get_power()):
await self.click_power(wait)
return True
return False
async def power_off(self, wait: bool) -> bool:
async def power_off(self, wait: bool) -> None:
if (await self.__get_power()):
await self.click_power(wait)
return True
return False
async def power_off_hard(self, wait: bool) -> bool:
async def power_off_hard(self, wait: bool) -> None:
if (await self.__get_power()):
await self.click_power_long(wait)
return True
return False
async def power_reset_hard(self, wait: bool) -> bool:
async def power_reset_hard(self, wait: bool) -> None:
if (await self.__get_power()):
await self.click_reset(wait)
return True
return False
# =====