# Light : Relay

実装 register

実装先 Light

Light : Relay

# ソースコード

Volang ソースを表示
// Light : Relay - implementation of the light block.
//
// Switches a lamp wired to a relay of a Voldeno module. The relay only knows
// on and off, so brightness and color are ignored, and there is no feedback:
// the light block publishes the state it commanded.

extern fn light_apply(power, brightness, color_mode, color_temp, hue, saturation) {
    if (power) {
        register::set(1)
    } else {
        register::set(0)
    }
    return 0
}
Voldeno スマートホーム自動化における Light : Relay Logic Block の動作、用途、設定方法を説明します。