We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4ca2a60 + a537119 commit 9c2ac11Copy full SHA for 9c2ac11
labgrid/strategy/ubootstrategy.py
@@ -57,3 +57,16 @@ def transition(self, status):
57
else:
58
raise StrategyError(f"no transition found from {self.status} to {status}")
59
self.status = status
60
+
61
+ def force(self, status):
62
+ if not isinstance(status, Status):
63
+ status = Status[status]
64
+ if status == Status.off:
65
+ self.target.activate(self.power)
66
+ elif status == Status.uboot:
67
+ self.target.activate(self.uboot)
68
+ elif status == Status.shell:
69
+ self.target.activate(self.shell)
70
+ else:
71
+ raise StrategyError("can not force state {}".format(status))
72
+ self.status = status
0 commit comments