mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Never lock rotation so that it remains usable on device side too.
This commit is contained in:
parent
7a598af243
commit
eadc0954a1
1 changed files with 8 additions and 6 deletions
|
@ -286,6 +286,13 @@ module.exports = syrup.serial()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin.rotate = function(rotation) {
|
||||||
|
return runAgentCommand(
|
||||||
|
apk.wire.MessageType.SET_ROTATION
|
||||||
|
, new apk.wire.SetRotationRequest(rotation, false)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
plugin.freezeRotation = function(rotation) {
|
plugin.freezeRotation = function(rotation) {
|
||||||
return runAgentCommand(
|
return runAgentCommand(
|
||||||
apk.wire.MessageType.SET_ROTATION
|
apk.wire.MessageType.SET_ROTATION
|
||||||
|
@ -510,12 +517,7 @@ module.exports = syrup.serial()
|
||||||
plugin.type(message.text)
|
plugin.type(message.text)
|
||||||
})
|
})
|
||||||
.on(wire.RotateMessage, function(channel, message) {
|
.on(wire.RotateMessage, function(channel, message) {
|
||||||
if (message.rotation >= 0) {
|
plugin.rotate(message.rotation)
|
||||||
plugin.freezeRotation(message.rotation)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
plugin.thawRotation()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.return(plugin)
|
.return(plugin)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue