-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx0gammadstate.py
More file actions
27 lines (21 loc) · 799 Bytes
/
x0gammadstate.py
File metadata and controls
27 lines (21 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class X0GammaDState:
"""Class to set and report the GammaD tracking"""
def __init__(self, useLog):
self.log = useLog
self.desired = None
self.mode = ''
def action(self):
if self.desired == None:
self.log.debug('Called with nothing to do')
return (True,self.mode)
self.mode = self.desired
self.log.debug(f'OnGammaD profile changed to "{self.mode}"')
self.desired = None
# we are done
return (True,self.mode)
def set(self, cmd:str, data: bytearray):
if self.desired:
self.log.error(f'Already set OnGammaD profile to {self.desired}')
else:
self.desired = cmd
self.log.debug(f'Asked to set OnGammaD profile to "{self.desired}"')