kotlin-homie / org.homieiot / Node

Node

class Node

Nodes are independent or logically separable parts of a device. For example, a car might expose a wheels node, an engine node and a lights node.

Functions

bool

fun bool(id: String, name: String? = null, type: PropertyType = PropertyType.STATE, init: Property<Boolean>.() -> Unit = {}): Property<Boolean>

Add a property of type boolean to this node

enum

fun <E : Enum<E>> enum(id: String, name: String? = null, type: PropertyType = PropertyType.STATE, unit: String? = null, init: Property<E>.() -> Unit = {}): Property<E>

Add a property of type enum to this node

float

fun float(id: String, name: String? = null, type: PropertyType = PropertyType.STATE, unit: String? = null, range: ClosedFloatingPointRange<Double>? = null, init: Property<Double>.() -> Unit = {}): Property<Double>

Add a property of type float to this node

hsv

fun hsv(id: String, name: String? = null, type: PropertyType = PropertyType.STATE, init: Property<HSV>.() -> Unit = {}): Property<HSV>

Add a property of color type hsv to this node

number

fun number(id: String, name: String? = null, type: PropertyType = PropertyType.STATE, unit: String? = null, range: LongRange? = null, init: Property<Long>.() -> Unit = {}): Property<Long>

Add a property of type number to this node

rgb

fun rgb(id: String, name: String? = null, type: PropertyType = PropertyType.STATE, init: Property<RGB>.() -> Unit = {}): Property<RGB>

Add a property of color type rgb to this node

string

fun string(id: String, name: String? = null, type: PropertyType = PropertyType.STATE, unit: String? = null, init: Property<String>.() -> Unit = {}): Property<String>

Add a property of type string to this node