fastcs.attributes.attr_w#

Members

AttrOnPutCallback

Callbacks to be called when the setpoint of an attribute is changed

AttrSyncSetpointCallback

Callbacks to be called when the setpoint of an attribute is changed

AttrW

A write-only Attribute.

fastcs.attributes.attr_w.AttrOnPutCallback#

Callbacks to be called when the setpoint of an attribute is changed

alias of Callable[[AttrW[DType_T, Any], DType_T], Awaitable[None]]

fastcs.attributes.attr_w.AttrSyncSetpointCallback#

Callbacks to be called when the setpoint of an attribute is changed

alias of Callable[[DType_T], Awaitable[None]]

class fastcs.attributes.attr_w.AttrW(datatype: DataType[DType_T], io_ref: AttributeIORefT | None = None, group: str | None = None, description: str | None = None)[source]#

A write-only Attribute.

async put(setpoint: DType_T, sync_setpoint: bool = False) None[source]#

Set the setpoint of the attribute

This should be called by clients to the attribute such as transports to apply a change to the attribute. The _on_put_callback will be called with this new setpoint, which may or may not take effect depending on the validity of the new value. For example, if the attribute has an IO to some device, the value might be rejected.

To directly change the value of the attribute, for example from an update loop that has read a new value from some underlying source, call the update method.

set_on_put_callback(callback: Callable[[AttrW[DType_T, Any], DType_T], Awaitable[None]]) None[source]#

Set the callback to call when the setpoint is changed

The callback will be called with the attribute and the new setpoint.

add_sync_setpoint_callback(callback: Callable[[DType_T], Awaitable[None]]) None[source]#

Add a callback to publish changes to the setpoint of the attribute

The callback will be called with the new setpoint.