- 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.
28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
package domain
|
|
|
|
// Climate represents a discovered climate (HVAC) entity.
|
|
type Climate struct {
|
|
// EntityID is the Home Assistant entity identifier.
|
|
EntityID EntityID
|
|
// FriendlyName is the user-facing name from Home Assistant attributes.
|
|
FriendlyName string
|
|
// State is the current raw HVAC mode, e.g. "cool", "off", "heat_cool".
|
|
State string
|
|
// HVACModes lists the modes Home Assistant reports as supported.
|
|
HVACModes []string
|
|
// FanMode is the current fan mode, when set.
|
|
FanMode string
|
|
// FanModes lists the fan modes Home Assistant reports as supported.
|
|
FanModes []string
|
|
// CurrentTemperature is nil when no sensor reading is available.
|
|
CurrentTemperature *float64
|
|
// TargetTemperature is nil when no target temperature is set.
|
|
TargetTemperature *float64
|
|
// TargetTempStep is the increment Home Assistant expects for set_temperature calls.
|
|
TargetTempStep float64
|
|
// MinTemp is the lower bound Home Assistant enforces for this entity.
|
|
MinTemp float64
|
|
// MaxTemp is the upper bound Home Assistant enforces for this entity.
|
|
MaxTemp float64
|
|
}
|