Skip to content

Commit 6d0c94c

Browse files
committed
added get_feature_flag_list and get_feature_flag
1 parent 67b52ba commit 6d0c94c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

anki_vector/robot.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,39 @@ async def get_latest_attention_transfer(self) -> protocol.LatestAttentionTransfe
815815
latest_attention_transfer = protocol.LatestAttentionTransferRequest()
816816
return await self.conn.grpc_interface.GetLatestAttentionTransfer(latest_attention_transfer)
817817

818+
@on_connection_thread(requires_control=False)
819+
async def get_feature_flag_list(self) -> protocol.FeatureFlagListResponse:
820+
"""Get a list of available feature flags the robot knows.
821+
822+
.. testcode::
818823
824+
import anki_vector
825+
with anki_vector.Robot() as robot:
826+
response = robot.get_feature_flag_list()
827+
if response:
828+
for feature in response.list:
829+
print(feature)
830+
"""
831+
get_feature_flag_list = protocol.FeatureFlagListRequest()
832+
return await self.conn.grpc_interface.GetFeatureFlagList(get_feature_flag_list)
833+
834+
@on_connection_thread(requires_control=False)
835+
async def get_feature_flag(self, feature_name: str) -> protocol.FeatureFlagResponse:
836+
"""Get the status of the given feature flag of the robot.
837+
838+
This let you check if a specific feature is valid and enabled (sufficiently developed to be used).
839+
840+
.. testcode::
841+
842+
import anki_vector
843+
with anki_vector.Robot(behavior_control_level=None) as robot:
844+
response = robot.get_feature_flag(feature_name='Exploring')
845+
if response:
846+
print(response)
847+
"""
848+
get_feature_flag = protocol.FeatureFlagRequest(feature_name= feature_name)
849+
return await self.conn.grpc_interface.GetFeatureFlag(get_feature_flag)
850+
819851
@on_connection_thread(requires_control=False)
820852
async def get_version_state(self) -> protocol.VersionStateResponse:
821853
"""Get the versioning information for Vector, including Vector's os_version and engine_build_id.

0 commit comments

Comments
 (0)