package kasa // OutletState is a normalized representation of an outlet or bulb on a Kasa device. type OutletState struct { Index int `json:"index"` OutletID string `json:"outlet_id,omitempty"` Alias string `json:"alias"` State bool `json:"state"` OnTime int `json:"on_time"` IsBulb bool `json:"is_bulb,omitempty"` Brightness int `json:"brightness,omitempty"` ColorTemp int `json:"color_temp,omitempty"` Hue int `json:"hue,omitempty"` Saturation int `json:"saturation,omitempty"` } // LightState represents the light_state object returned by Kasa smart bulbs (e.g. KL125). type LightState struct { OnOff int `json:"on_off"` Mode string `json:"mode,omitempty"` Hue int `json:"hue,omitempty"` Saturation int `json:"saturation,omitempty"` ColorTemp int `json:"color_temp,omitempty"` Brightness int `json:"brightness,omitempty"` } // ChildOutlet represents one outlet on a multi-plug strip (e.g. KP303). type ChildOutlet struct { ID string `json:"id"` State int `json:"state"` Alias string `json:"alias"` OnTime int `json:"on_time"` } // GetSysInfoResult holds the sysinfo response from a Kasa device. type GetSysInfoResult struct { ErrCode int `json:"err_code"` Model string `json:"model"` Alias string `json:"alias"` MAC string `json:"mac"` DeviceId string `json:"deviceId"` MicType string `json:"mic_type,omitempty"` Type string `json:"type,omitempty"` RelayState int `json:"relay_state"` OnTime int `json:"on_time"` LightState *LightState `json:"light_state,omitempty"` Children []ChildOutlet `json:"children,omitempty"` } // SysInfoResponse wraps the standard system get_sysinfo response. type SysInfoResponse struct { System struct { GetSysInfo GetSysInfoResult `json:"get_sysinfo"` } `json:"system"` } // SetRelayStateResponse wraps the set_relay_state response. type SetRelayStateResponse struct { System struct { SetRelayState struct { ErrCode int `json:"err_code"` } `json:"set_relay_state"` } `json:"system"` } // TransitionLightStateResponse wraps the smartlife.iot.smartbulb.lightingservice transition_light_state response. type TransitionLightStateResponse struct { LightingService struct { TransitionLightState struct { ErrCode int `json:"err_code"` } `json:"transition_light_state"` } `json:"smartlife.iot.smartbulb.lightingservice"` }