Skip to content
Snippets Groups Projects

Partially merge state and conditionsMatch auxiliary state of BaseCondition

Merged David Hammer requested to merge condition-watcher-merge-state into master
1 file
+ 11
3
Compare changes
  • Side-by-side
  • Inline
@@ -12,6 +12,7 @@ from karabo.middlelayer import (
Proxy,
Slot,
State,
StateSignifier,
String,
VectorHash,
VectorString,
@@ -66,6 +67,7 @@ class ConditionBase(Device):
raise NotImplementedError("Subclass must implement!")
async def onInitialization(self):
self._state_signifier = StateSignifier()
self.state = State.INIT
self._manager_dev = await connectDevice(self.managerDeviceId.value)
if self._manager_dev.classId.value == "CalibrationManager":
@@ -149,7 +151,9 @@ class ConditionBase(Device):
self._monitor = background(aux)
self._control_devs = control_devs
self.state = State.MONITORING
self.state = self._state_signifier.returnMostSignificant(
[State.MONITORING, State[self.conditionsMatch]]
)
@Slot(
allowedStates=[State.MONITORING],
@@ -296,7 +300,9 @@ class ConditionBase(Device):
async def checkConditions(self):
self.state = State.CHANGING
await self._check_or_update(False)
self.state = State.ON
self.state = self._state_signifier.returnMostSignificant(
[State.ON, State[self.conditionsMatch]]
)
@Slot(
allowedStates=[State.ON],
@@ -307,7 +313,9 @@ class ConditionBase(Device):
async def updateConditions(self):
self.state = State.CHANGING
await self._check_or_update(True)
self.state = State.ON
self.state = self._state_signifier.returnMostSignificant(
[State.ON, State[self.conditionsMatch]]
)
availableScenes = VectorString(
displayedName="Available scenes",
Loading