Skip to content

Commit baf6ff9

Browse files
committed
add app_intent behaviour method
1 parent 9631c74 commit baf6ff9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

anki_vector/behavior.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,26 @@ async def say_text(self, text: str, use_vector_voice: bool = True, duration_scal
201201
duration_scalar=duration_scalar)
202202
return await self.conn.grpc_interface.SayText(say_text_request)
203203

204+
# TODO Make this cancellable with is_cancellable_behavior
205+
@connection.on_connection_thread()
206+
async def app_intent(self, intent: str, param: str = None) -> protocol.AppIntentResponse:
207+
"""Send Vector an intention to do something.
208+
209+
.. testcode::
210+
211+
import anki_vector
212+
with anki_vector.Robot() as robot:
213+
robot.behavior.app_intent(intent='intent_system_sleep')
214+
215+
:param intent: The intention key
216+
:param param: Intention parameter
217+
218+
:return: object that provides the status
219+
"""
220+
221+
app_intent_request = protocol.AppIntentRequest(intent=intent, param=param)
222+
return await self.conn.grpc_interface.AppIntent(app_intent_request)
223+
204224
# TODO Make this cancellable with is_cancellable_behavior?
205225
@connection.on_connection_thread()
206226
async def set_eye_color(self, hue: float, saturation: float) -> protocol.SetEyeColorResponse:

0 commit comments

Comments
 (0)