add ui, new config opts

This commit is contained in:
2026-07-16 16:32:44 -04:00
parent 8effff311b
commit df01e060e4
33 changed files with 1104 additions and 37 deletions
+33 -19
View File
@@ -40,6 +40,7 @@ const (
Mode_MODE_GAS Mode = 6
Mode_MODE_PERFORMANCE Mode = 7
Mode_MODE_VACATION Mode = 8
Mode_MODE_ELECTRIC_GAS Mode = 9 // combined electric/gas backup mode (e.g. hybrid units)
)
// Enum value maps for Mode.
@@ -54,6 +55,7 @@ var (
6: "MODE_GAS",
7: "MODE_PERFORMANCE",
8: "MODE_VACATION",
9: "MODE_ELECTRIC_GAS",
}
Mode_value = map[string]int32{
"MODE_UNSPECIFIED": 0,
@@ -65,6 +67,7 @@ var (
"MODE_GAS": 6,
"MODE_PERFORMANCE": 7,
"MODE_VACATION": 8,
"MODE_ELECTRIC_GAS": 9,
}
)
@@ -117,6 +120,7 @@ type Device struct {
AlertCount int32 `protobuf:"varint,16,opt,name=alert_count,json=alertCount,proto3" json:"alert_count,omitempty"`
Away bool `protobuf:"varint,17,opt,name=away,proto3" json:"away,omitempty"`
LastUpdated *timestamppb.Timestamp `protobuf:"bytes,18,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"`
SupportedModes []Mode `protobuf:"varint,19,rep,packed,name=supported_modes,json=supportedModes,proto3,enum=econet.v1alpha1.Mode" json:"supported_modes,omitempty"` // modes this device can be set to (may be empty)
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -277,6 +281,13 @@ func (x *Device) GetLastUpdated() *timestamppb.Timestamp {
return nil
}
func (x *Device) GetSupportedModes() []Mode {
if x != nil {
return x.SupportedModes
}
return nil
}
type ListDevicesRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
@@ -547,7 +558,7 @@ var File_econet_v1alpha1_econet_proto protoreflect.FileDescriptor
const file_econet_v1alpha1_econet_proto_rawDesc = "" +
"\n" +
"\x1ceconet/v1alpha1/econet.proto\x12\x0feconet.v1alpha1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xde\x04\n" +
"\x1ceconet/v1alpha1/econet.proto\x12\x0feconet.v1alpha1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9e\x05\n" +
"\x06Device\x12#\n" +
"\rserial_number\x18\x01 \x01(\tR\fserialNumber\x12\x1b\n" +
"\tdevice_id\x18\x02 \x01(\tR\bdeviceId\x12#\n" +
@@ -569,7 +580,8 @@ const file_econet_v1alpha1_econet_proto_rawDesc = "" +
"\valert_count\x18\x10 \x01(\x05R\n" +
"alertCount\x12\x12\n" +
"\x04away\x18\x11 \x01(\bR\x04away\x12=\n" +
"\flast_updated\x18\x12 \x01(\v2\x1a.google.protobuf.TimestampR\vlastUpdated\"\x14\n" +
"\flast_updated\x18\x12 \x01(\v2\x1a.google.protobuf.TimestampR\vlastUpdated\x12>\n" +
"\x0fsupported_modes\x18\x13 \x03(\x0e2\x15.econet.v1alpha1.ModeR\x0esupportedModes\"\x14\n" +
"\x12ListDevicesRequest\"H\n" +
"\x13ListDevicesResponse\x121\n" +
"\adevices\x18\x01 \x03(\v2\x17.econet.v1alpha1.DeviceR\adevices\"@\n" +
@@ -582,7 +594,7 @@ const file_econet_v1alpha1_econet_proto_rawDesc = "" +
"\x04mode\x18\x02 \x01(\x0e2\x15.econet.v1alpha1.ModeB\n" +
"\xbaH\a\x82\x01\x04\x10\x01 \x00R\x04mode\"B\n" +
"\x0fSetModeResponse\x12/\n" +
"\x06device\x18\x01 \x01(\v2\x17.econet.v1alpha1.DeviceR\x06device*\xb6\x01\n" +
"\x06device\x18\x01 \x01(\v2\x17.econet.v1alpha1.DeviceR\x06device*\xcd\x01\n" +
"\x04Mode\x12\x14\n" +
"\x10MODE_UNSPECIFIED\x10\x00\x12\f\n" +
"\bMODE_OFF\x10\x01\x12\x11\n" +
@@ -592,7 +604,8 @@ const file_econet_v1alpha1_econet_proto_rawDesc = "" +
"\x10MODE_HIGH_DEMAND\x10\x05\x12\f\n" +
"\bMODE_GAS\x10\x06\x12\x14\n" +
"\x10MODE_PERFORMANCE\x10\a\x12\x11\n" +
"\rMODE_VACATION\x10\b2\x84\x03\n" +
"\rMODE_VACATION\x10\b\x12\x15\n" +
"\x11MODE_ELECTRIC_GAS\x10\t2\x84\x03\n" +
"\rEconetService\x12s\n" +
"\vListDevices\x12#.econet.v1alpha1.ListDevicesRequest\x1a$.econet.v1alpha1.ListDevicesResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1alpha1/devices\x12}\n" +
"\tGetDevice\x12!.econet.v1alpha1.GetDeviceRequest\x1a\".econet.v1alpha1.GetDeviceResponse\")\x82\xd3\xe4\x93\x02#\x12!/v1alpha1/devices/{serial_number}\x12\x7f\n" +
@@ -626,21 +639,22 @@ var file_econet_v1alpha1_econet_proto_goTypes = []any{
}
var file_econet_v1alpha1_econet_proto_depIdxs = []int32{
8, // 0: econet.v1alpha1.Device.last_updated:type_name -> google.protobuf.Timestamp
1, // 1: econet.v1alpha1.ListDevicesResponse.devices:type_name -> econet.v1alpha1.Device
1, // 2: econet.v1alpha1.GetDeviceResponse.device:type_name -> econet.v1alpha1.Device
0, // 3: econet.v1alpha1.SetModeRequest.mode:type_name -> econet.v1alpha1.Mode
1, // 4: econet.v1alpha1.SetModeResponse.device:type_name -> econet.v1alpha1.Device
2, // 5: econet.v1alpha1.EconetService.ListDevices:input_type -> econet.v1alpha1.ListDevicesRequest
4, // 6: econet.v1alpha1.EconetService.GetDevice:input_type -> econet.v1alpha1.GetDeviceRequest
6, // 7: econet.v1alpha1.EconetService.SetMode:input_type -> econet.v1alpha1.SetModeRequest
3, // 8: econet.v1alpha1.EconetService.ListDevices:output_type -> econet.v1alpha1.ListDevicesResponse
5, // 9: econet.v1alpha1.EconetService.GetDevice:output_type -> econet.v1alpha1.GetDeviceResponse
7, // 10: econet.v1alpha1.EconetService.SetMode:output_type -> econet.v1alpha1.SetModeResponse
8, // [8:11] is the sub-list for method output_type
5, // [5:8] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
0, // 1: econet.v1alpha1.Device.supported_modes:type_name -> econet.v1alpha1.Mode
1, // 2: econet.v1alpha1.ListDevicesResponse.devices:type_name -> econet.v1alpha1.Device
1, // 3: econet.v1alpha1.GetDeviceResponse.device:type_name -> econet.v1alpha1.Device
0, // 4: econet.v1alpha1.SetModeRequest.mode:type_name -> econet.v1alpha1.Mode
1, // 5: econet.v1alpha1.SetModeResponse.device:type_name -> econet.v1alpha1.Device
2, // 6: econet.v1alpha1.EconetService.ListDevices:input_type -> econet.v1alpha1.ListDevicesRequest
4, // 7: econet.v1alpha1.EconetService.GetDevice:input_type -> econet.v1alpha1.GetDeviceRequest
6, // 8: econet.v1alpha1.EconetService.SetMode:input_type -> econet.v1alpha1.SetModeRequest
3, // 9: econet.v1alpha1.EconetService.ListDevices:output_type -> econet.v1alpha1.ListDevicesResponse
5, // 10: econet.v1alpha1.EconetService.GetDevice:output_type -> econet.v1alpha1.GetDeviceResponse
7, // 11: econet.v1alpha1.EconetService.SetMode:output_type -> econet.v1alpha1.SetModeResponse
9, // [9:12] is the sub-list for method output_type
6, // [6:9] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_econet_v1alpha1_econet_proto_init() }
File diff suppressed because one or more lines are too long