add set mode option
Build and Publish / container-images (push) Has been skipped
Build and Publish / check-chart (push) Successful in 15s
Build and Publish / go-binaries (push) Has been skipped
Build and Publish / helm-release (push) Has been skipped

This commit is contained in:
2026-07-16 15:35:12 -04:00
parent 8e0e59db16
commit 52ed5a7e3a
10 changed files with 731 additions and 25 deletions
+36
View File
@@ -30,6 +30,22 @@ message Device {
google.protobuf.Timestamp last_updated = 18;
}
// Mode is a settable operating mode for a water heater. The values mirror the
// kebab-case slugs reported in Device.mode. Not every device supports every
// mode; the supported set is device-specific (derived from the unit's reported
// mode list), so SetMode validates against the target device.
enum Mode {
MODE_UNSPECIFIED = 0;
MODE_OFF = 1;
MODE_ELECTRIC = 2;
MODE_ENERGY_SAVING = 3;
MODE_HEAT_PUMP = 4;
MODE_HIGH_DEMAND = 5;
MODE_GAS = 6;
MODE_PERFORMANCE = 7;
MODE_VACATION = 8;
}
message ListDevicesRequest {}
message ListDevicesResponse {
@@ -44,6 +60,20 @@ message GetDeviceResponse {
Device device = 1;
}
message SetModeRequest {
string serial_number = 1 [(buf.validate.field).string.min_len = 1];
Mode mode = 2 [(buf.validate.field).enum = {
defined_only: true
not_in: [0]
}];
}
message SetModeResponse {
// Last-known device state. The mode change is applied asynchronously by the
// Rheem cloud, so this reflects the requested mode only after a later poll.
Device device = 1;
}
// EconetService exposes read-only access to Rheem EcoNet device state.
service EconetService {
rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse) {
@@ -52,4 +82,10 @@ service EconetService {
rpc GetDevice(GetDeviceRequest) returns (GetDeviceResponse) {
option (google.api.http) = {get: "/v1alpha1/devices/{serial_number}"};
}
rpc SetMode(SetModeRequest) returns (SetModeResponse) {
option (google.api.http) = {
post: "/v1alpha1/devices/{serial_number}/mode"
body: "*"
};
}
}