Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include device .name in API data #297

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bluesky_queueserver/manager/profile_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -3294,13 +3294,14 @@ def _prepare_devices(devices, *, max_depth=0, ignore_all_subdevices_if_one_fails
from bluesky import protocols
from ophyd.areadetector import ADBase

def get_device_params(device):
def get_device_params(device, device_obj_name):
return {
"is_readable": isinstance(device, protocols.Readable),
"is_movable": isinstance(device, protocols.Movable),
"is_flyable": isinstance(device, protocols.Flyable),
"classname": type(device).__name__,
"module": type(device).__module__,
"name": device.name if isinstance(device, protocols.HasName) else device_obj_name,
}

def get_device_component_names(device):
Expand All @@ -3313,7 +3314,7 @@ def get_device_component_names(device):
return component_names

def create_device_description(device, device_name, *, depth=0, max_depth=0, is_registered=False):
description = get_device_params(device)
description = get_device_params(device, device_name)
comps = get_device_component_names(device)
components = {}

Expand Down
Loading
Loading