Skip to content

Classes that only extend Device aren't treated as BlueskyDevices #1369

@tpoliaw

Description

@tpoliaw

If a plan accepts a parameter that is typed as a class that extends only Device but not any of the bluesky protocols, it is not recognised as a bluesky device and doesn't have the reference type added that supports passing devices by name.

from ophyd_async.core import Device

class Demo(Device):
    pass

def sample_plan(demo: Demo) -> MsgGenerator:
    yield from []

When trying to run this plan using a string name as the argument for demo, the error returned will be of the form Input should be an instance of Demo instead of the expected Value error, Device demo is not of type sample_plans.Demo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions