diff options
Diffstat (limited to 'ATRI/service/dormant.py')
-rw-r--r-- | ATRI/service/dormant.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ATRI/service/dormant.py b/ATRI/service/dormant.py new file mode 100644 index 0000000..7482d53 --- /dev/null +++ b/ATRI/service/dormant.py @@ -0,0 +1,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!') |