blob: 7482d537de72ef06a8f91b3d40fd57051f85eba9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from ATRI.exceptions import InvalidSetting
from . import state
class Dormant:
@staticmethod
def is_sleep() -> bool:
return True if state != 1 else False
@staticmethod
def cont_wake(_type: bool) -> None:
global state
try:
if _type:
state = 0
else:
state = 1
except InvalidSetting:
raise InvalidSetting('Failed to modify variable!')
|