Protocol Documentation

Table of Contents

OpenControllerLib.proto

Top

OpenController Proto

A Protocol Buffer schema representing an OpenController module.

CallExpr

A message representing a function call

FieldTypeLabelDescription
calling Expr required

The expression to call

args Expr repeated

The arguments to pass

ControllerExpr

A message representing a controller

FieldTypeLabelDescription
id Expr required

A unique id for the controller

display_name Expr required

The name to be displayed by clients

brand_color Expr optional

A brand color to be displayed by clients

display_interface Expr optional

The interface for display clients for the Controller

DeviceExpr

A message representing a controllable device

FieldTypeLabelDescription
lambdas DeviceExpr.LambdasEntry repeated

The actions the Device is capable of

DeviceExpr.LambdasEntry

FieldTypeLabelDescription
key string optional

value Expr optional

DisplayInterfaceExpr

A Controller interface for clients with displays

FieldTypeLabelDescription
widgets Expr repeated

The Widgets that make up the controller. Implementation Notes: The layout of the widgets in the array is flexible for the client.

Elif

A message representing an else-if

FieldTypeLabelDescription
condition Expr required

The condition to call if

then Expr required

The expression to call

Expr

A message representing an expression

FieldTypeLabelDescription
position Position optional

The position of the expression in the source code

ref RefExpr optional

lambda LambdaExpr optional

call CallExpr optional

string string optional

int64 int64 optional

int32 int32 optional

float float optional

bool bool optional

house HouseExpr optional

room RoomExpr optional

controller ControllerExpr optional

display_interface DisplayInterfaceExpr optional

device DeviceExpr optional

widget WidgetExpr optional

if IfExpr optional

HouseExpr

The root message representing a house. *

FieldTypeLabelDescription
display_name Expr required

The name to be displayed by clients

id Expr required

A unique identifier

rooms Expr repeated

The Rooms inside the House

IfExpr

A message representing an if expression

FieldTypeLabelDescription
condition Expr required

The condition to call if

then Expr required

The expression to call

elif Elif repeated

The else-if conditions

else Expr required

The else condition

LambdaExpr

A message representing a lambda expression

FieldTypeLabelDescription
args string repeated

The args to the lambda

return Expr required

The return of the lambda

Module

A message representing an OpenController module

FieldTypeLabelDescription
imports Module.ImportsEntry repeated

The imports of the module

body Expr required

The body of the module

Module.ImportsEntry

FieldTypeLabelDescription
key string optional

value Module optional

Position

A message representing the position of an expression in source code

FieldTypeLabelDescription
file string required

The file path

line int32 required

The line number

column int32 required

The column number

RefExpr

A message representing a reference to the cope

FieldTypeLabelDescription
ref string required

The name of the desired reference in the scope

RoomExpr

A message representing a room.

FieldTypeLabelDescription
id Expr required

A unique id for the room

display_name Expr required

The name to be displayed by clients

controllers Expr repeated

The Controllers inside the Room

icon Expr optional

The icon of the Room to be displayed by clients

WidgetExpr

A message representing any controller widget that can be displayed by clients

FieldTypeLabelDescription
widget_type string required

The type of widget

params WidgetExpr.ParamsEntry repeated

The parameters to the widget

children Expr repeated

The children of the widget

WidgetExpr.ParamsEntry

FieldTypeLabelDescription
key string optional

value Expr optional

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)