Example #1
0
def _add_device_specific_skill(context):
    dirty_skill, dirty_skill_settings = add_skill(
        context.db,
        skill_global_id='@{device_id}|device-specific-skill|19.02'.format(
            device_id=context.device_id))
    context.skills.update(dirty=(dirty_skill, dirty_skill_settings))
    context.device_specific_manifest = add_device_skill(
        context.db, context.device_id, dirty_skill)
Example #2
0
def _add_device_specific_skill(context):
    """Add a skill with a device specific skill GID."""
    dirty_skill, dirty_skill_settings = add_skill(
        context.db,
        skill_global_id="@{device_id}|device-specific-skill|19.02".format(
            device_id=context.device_id),
    )
    context.skills.update(dirty=(dirty_skill, dirty_skill_settings))
    context.device_specific_skill = add_device_skill(context.db,
                                                     context.device_id,
                                                     dirty_skill)
Example #3
0
def _add_device_skills(context):
    for value in context.skills.values():
        skill, settings_display = value
        context.manifest_skill = add_device_skill(context.db,
                                                  context.device_id, skill)
        settings_values = None
        if skill.skill_gid.startswith('bar'):
            settings_values = dict(textfield='Device text value')
        add_device_skill_settings(context.db,
                                  context.device_id,
                                  settings_display,
                                  settings_values=settings_values)
Example #4
0
def _add_device_skills(context):
    """Link skills to devices for use in step code."""
    for value in context.skills.values():
        skill, settings_display = value
        context.manifest_skill = add_device_skill(context.db,
                                                  context.device_id, skill)
        settings_values = None
        if skill.skill_gid.startswith("bar"):
            settings_values = dict(textfield="Device text value",
                                   checkboxfield="false")
        add_device_skill_settings(
            context.db,
            context.device_id,
            settings_display,
            settings_values=settings_values,
        )