home-services/proto/ha/v1/light.proto

28 lines
1.0 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package ha.v1;
option go_package = "gitea.nik4nao.com/nik/home-services/gen/ha/v1;hav1";
import "ha/v1/common.proto";
service LightService {
rpc TurnOn(TurnOnRequest) returns (LightResponse);
rpc TurnOff(TurnOffRequest) returns (LightResponse);
rpc Toggle(ToggleRequest) returns (LightResponse);
}
// optional fields require protobuf 3.15+ / buf >= 1.0. They generate
// pointer fields in Go with Has*() accessor methods. This is intentional —
// it lets the gateway distinguish "brightness not set" from "brightness = 0".
message TurnOnRequest {
string entity_id = 1;
optional uint32 brightness_pct = 2; // 0100
optional uint32 color_temp_kelvin = 3; // e.g. 27006500
optional RGBColor rgb_color = 4; // ignored if color_temp_kelvin set
optional uint32 transition = 5; // seconds
}
message TurnOffRequest {
string entity_id = 1;
optional uint32 transition = 2;
}
message ToggleRequest { string entity_id = 1; }
message LightResponse { EntityState state = 1; }