- Added ClimateApp to handle climate entity operations including turning on/off, adjusting temperature, and setting HVAC modes. - Implemented caching mechanism for climate entities to optimize state retrieval. - Created domain model for Climate with attributes such as current temperature, target temperature, and HVAC modes. - Developed unit tests for ClimateApp to ensure functionality and correctness. feat: add RemoteApp for SwitchBot commands - Introduced RemoteApp to facilitate sending commands to SwitchBot devices. - Implemented SendCommand method for executing device commands without state management. chore: update configuration for SwitchBot integration - Added SwitchBotToken and SwitchBotSecret to configuration for enabling SwitchBot Cloud commands. feat: define gRPC services for Climate and Remote operations - Created climate.proto and remote.proto files to define gRPC services for climate management and remote command execution. - Implemented corresponding request and response message structures for gRPC interactions.
42 lines
1.4 KiB
Protocol Buffer
42 lines
1.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
package ha.v1;
|
|
option go_package = "gitea.nik4nao.com/nik/home-services/gen/ha/v1;hav1";
|
|
import "ha/v1/common.proto";
|
|
|
|
service ClimateService {
|
|
rpc TurnOn(ClimateRequest) returns (ClimateResponse);
|
|
rpc TurnOff(ClimateRequest) returns (ClimateResponse);
|
|
rpc IncreaseTemperature(ClimateRequest) returns (ClimateResponse);
|
|
rpc DecreaseTemperature(ClimateRequest) returns (ClimateResponse);
|
|
rpc SetHVACMode(SetHVACModeRequest) returns (ClimateResponse);
|
|
rpc ListClimates(ListClimatesRequest) returns (ListClimatesResponse);
|
|
}
|
|
|
|
message ClimateRequest { string entity_id = 1; }
|
|
message ClimateResponse { EntityState state = 1; }
|
|
|
|
message SetHVACModeRequest {
|
|
string entity_id = 1;
|
|
string hvac_mode = 2;
|
|
}
|
|
|
|
message ClimateEntity {
|
|
string entity_id = 1;
|
|
string friendly_name = 2;
|
|
string state = 3;
|
|
repeated string hvac_modes = 4;
|
|
string fan_mode = 5;
|
|
repeated string fan_modes = 6;
|
|
optional float current_temperature = 7;
|
|
optional float target_temperature = 8;
|
|
float target_temp_step = 9;
|
|
float min_temp = 10;
|
|
float max_temp = 11;
|
|
}
|
|
|
|
message ListClimatesRequest {}
|
|
|
|
message ListClimatesResponse {
|
|
repeated ClimateEntity climates = 1;
|
|
}
|