Files

26 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

workspace Controllers id "workspace:controllers" revision "workspace:controllers@1" commit "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" {
import interface Device;
import interface DeviceController;
import package Driver;
atom Display id "device:display";
conform Display as Device id "display:device" {
private state Enabled id "display:enabled" on Display : bool policy register;
private state Requested id "display:requested" on Display : record {url:string;text:string;version:int32;} policy register;
private state Observed id "display:observed" on Display : optional<record {url:string;text:string;version:int32;}> policy register;
initialize {enabled to state Enabled;requested to state Requested;observed to state Observed;};
bind create.call to package Driver.create with {device to creation Display with {Device from input;};};
bind enabled.get to state Enabled.read;
bind enabled.set to state Enabled.write;
bind requested.get to state Requested.read;
bind observed.get to state Observed.read;
bind requestText.call to package Driver.request with {requested to state Requested;};
bind recordObservation.call to package Driver.recordObservation with {requested to state Requested;observed to state Observed;};
bind remove.call to lifecycle.delete;
}
conform Display as DeviceController id "display:controller" {
bind enabled.get to package Driver.enabled with {data to interface Device;};
bind snapshot.call to package Driver.snapshot with {data to interface Device;};
bind apply.call to package Driver.apply with {device to interface Device;};
}
}