Nik Afiq 6ea4e84949
All checks were successful
CI / test (push) Successful in 4s
CI / build-ha-gateway (push) Successful in 1m7s
CI / build-discord-bot (push) Successful in 51s
Enhance Discord bot and HA gateway with improved structure and documentation
- Added detailed comments to clarify the purpose of various functions and types in the Discord bot and HA gateway.
- Introduced new methods in the CommandApp for handling light and switch operations, including HandleLightOn, HandleLightOff, HandleLightToggle, and their respective autocomplete functions.
- Updated the HAClient interface to include methods for fetching states and calling services, enhancing the interaction with Home Assistant.
- Improved the structure of entity and light domain models to include additional attributes and clearer documentation.
- Implemented logging enhancements in both the Discord bot and HA gateway to ensure better traceability and context in logs.
- Refactored the configuration loading process to streamline environment variable handling and defaults.
- Stubbed out switch control methods in the gRPC adapter, indicating future implementation plans.
- Enhanced telemetry setup to ensure proper initialization and shutdown procedures for observability.
2026-04-09 06:00:59 +09:00

14 lines
495 B
Go

package domain
// Switch represents a discovered switch entity.
type Switch 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 switch state, usually on, off, or unavailable.
State string // "on" | "off" | "unavailable"
// DeviceClass identifies the switch semantic type when Home Assistant sets it.
DeviceClass string // e.g. "switch"
}