Versions in this module Expand all Collapse all v1 v1.0.4 Mar 11, 2023 v1.0.3 Mar 5, 2023 v1.0.2 Mar 5, 2023 v1.0.1 Mar 5, 2023 Changes in this version + const DefaultEndpoint + func ParseWebhookRequest(r *http.Request) (interface{}, error) + type ACFanSpeed int + const ACAutoSpeed + const ACHigh + const ACLow + const ACMedium + type ACMode int + const ACAuto + const ACCool + const ACDry + const ACFan + const ACHeat + type AmbientBrightness string + const AmbientBrightnessBright + const AmbientBrightnessDim + type BrightnessState struct + func (brightness *BrightnessState) UnmarshalJSON(b []byte) error + func (brightness BrightnessState) AmbientBrightness() (AmbientBrightness, error) + func (brightness BrightnessState) Int() (int, error) + type CeilingEvent struct + Context CeilingEventContext + EventType string + EventVersion string + type CeilingEventContext struct + Brightness int + ColorTemperature int + DeviceMac string + DeviceType string + PowerState PowerState + TimeOfSample int64 + type CleanerOnlineStatus string + const CleanerOffline + const CleanerOnline + type CleanerWorkingStatus string + const CleanerChargeDone + const CleanerCharging + const CleanerClearing + const CleanerDormant + const CleanerGotoChargeBase + const CleanerInDustCollecting + const CleanerInRemoteControl + const CleanerInTrouble + const CleanerPaused + const CleanerStandBy + type Client struct + func New(openToken, secretKey string, opts ...Option) *Client + func (c *Client) Device() *DeviceService + func (c *Client) Scene() *SceneService + func (c *Client) Webhook() *WebhookService + type ColorBulbEvent struct + Context ColorBulbEventContext + EventType string + EventVersion string + type ColorBulbEventContext struct + Brightness int + Color string + ColorTemperature int + DeviceMac string + DeviceType string + PowerState PowerState + TimeOfSample int64 + type Command interface + Request func() DeviceCommandRequest + func ACSetAllCommand(temperature int, mode ACMode, fanSpeed ACFanSpeed, power PowerState) Command + func ButtonPushCommand(name string) Command + func ChannelAddCommand() Command + func ChannelSubCommand() Command + func CreateKeyCommand(name string, typ PasscodeType, password string, start, end time.Time) (Command, error) + func DeleteKeyCommand(id int) Command + func DockCommand() Command + func FanHighSpeedCommand() Command + func FanLowSpeedCommand() Command + func FanMiddleSpeedCommand() Command + func FanSwingCommand() Command + func FanTimerCommand() Command + func FastForwardCommand() Command + func LightBrightnessDownCommand() Command + func LightBrightnessUpCommand() Command + func LockCommand() Command + func NextCommand() Command + func PauseCommand() Command + func PlayCommand() Command + func PowLevelCommand(level VacuumPowerLevel) Command + func PressCommand() Command + func PreviousCommand() Command + func RewindCommand() Command + func SetAllStatusCommand(power PowerState, fanMode SmartFanMode, fanSpeed, shakeRange int) Command + func SetBrightnessCommand(brightness int) Command + func SetChannelCommand(channelNumber int) Command + func SetColorCommand(r, g, b int) Command + func SetColorTemperatureCommand(temperature int) Command + func SetModeCommand(mode HumidifierMode) Command + func SetMuteCommand() Command + func SetPosition(index int, mode SetPositionMode, position int) Command + func StartCommand() Command + func StopCommand() Command + func StopPlayerCommand() Command + func ToggleCommand() Command + func TurnOffCommand() Command + func TurnOnCommand() Command + func UnlockCommand() Command + func VolumeAddCommand() Command + func VolumeSubCommand() Command + type ContactSensorEvent struct + Context ContactSensorEventContext + EventType string + EventVersion string + type ContactSensorEventContext struct + Brightness AmbientBrightness + DetectionState string + DeviceMac string + DeviceType string + DoorMode string + OpenState string + TimeOfSample int64 + type Device struct + Curtains []string + GroupName bool + Hub string + ID string + IsCalibrated bool + IsEnableCloudService bool + IsGrouped bool + IsMaster bool + KeyList []KeyListItem + LockDeviceID string + LockDeviceIDs []string + Name string + OpenDirection string + Type PhysicalDeviceType + type DeviceCommandRequest struct + Command string + CommandType string + Parameter string + func (req DeviceCommandRequest) Request() DeviceCommandRequest + type DeviceService struct + func (svc *DeviceService) Command(ctx context.Context, id string, cmd Command) error + func (svc *DeviceService) List(ctx context.Context) ([]Device, []InfraredDevice, error) + func (svc *DeviceService) Status(ctx context.Context, id string) (DeviceStatus, error) + type DeviceStatus struct + Battery int + Brightness BrightnessState + Color string + ColorTemperature int + DoorState string + ElectricCurrent float64 + ElectricityOfDay int + FanMode int + FanSpeed int + Hub string + Humidity int + ID string + IsAuto bool + IsCalibrated bool + IsChildLock bool + IsGrouped bool + IsLackWater bool + IsMoveDetected bool + IsMoving bool + IsShaking bool + IsSound bool + LockState string + NebulizationEfficiency int + OnlineStatus CleanerOnlineStatus + OpenState OpenState + Power PowerState + ShakeCenter int + ShakeRange int + SlidePosition int + Temperature float64 + Type PhysicalDeviceType + Voltage float64 + Weight float64 + WorkingStatus CleanerWorkingStatus + type HumidifierMode int + const AutoMode + const HighMode + const LowMode + const MidMode + type IndoorCamEvent struct + Context IndoorCamEventContext + EventType string + EventVersion string + type IndoorCamEventContext struct + DetectionState string + DeviceMac string + DeviceType string + TimeOfSample int64 + type InfraredDevice struct + Hub string + ID string + Name string + Type VirtualDeviceType + type KeyListItem struct + CreateTime int64 + ID int + IV string + Name string + Password string + Status PasscodeStatus + Type PasscodeType + type KeypadEvent struct + Context KeypadEventContext + EventType string + EventVersion string + type KeypadEventContext struct + CommandID string + DeviceMac string + DeviceType string + EventName string + Result string + TimeOfSample int64 + type LockEvent struct + Context LockEventContext + EventType string + EventVersion string + type LockEventContext struct + DeviceMac string + DeviceType string + LockState string + TimeOfSample int64 + type MeterEvent struct + Context MeterEventContext + EventType string + EventVersion string + type MeterEventContext struct + DeviceMac string + DeviceType string + Humidity int + Scale string + Temperature float64 + TimeOfSample int64 + type MeterPlusEvent struct + Context MeterPlusEventContext + EventType string + EventVersion string + type MeterPlusEventContext struct + DeviceMac string + DeviceType string + Humidity int + Scale string + Temperature float64 + TimeOfSample int64 + type MotionSensorEvent struct + Context MotionSensorEventContext + EventType string + EventVersion string + type MotionSensorEventContext struct + DetectionState string + DeviceMac string + DeviceType string + TimeOfSample int64 + type OpenState string + const ContactClose + const ContactOpen + const ContactTimeoutNotClose + type Option func(*Client) + func WithDebug() Option + func WithEndpoint(endpoint string) Option + func WithHTTPClient(httpClient *http.Client) Option + type PanTiltCamEvent struct + Context PanTiltCamEventContext + EventType string + EventVersion string + type PanTiltCamEventContext struct + DetectionState string + DeviceMac string + DeviceType string + TimeOfSample int64 + type PasscodeStatus string + const PasscodeStatusValid + const PasscodeStautsInvalid + type PasscodeType string + const DisposablePasscode + const PermanentPasscode + const TimeLimitPasscode + const UrgentPasscode + type PhysicalDeviceType string + const Bot + const CeilingLight + const CeilingLightPro + const ColorBulb + const ContactSensor + const Curtain + const Hub + const HubMini + const HubPlus + const Humidifier + const IndoorCam + const KeyPad + const KeyPadTouch + const Lock + const Meter + const MeterPlus + const MeterPlusJP + const MeterPlusUS + const MotionSensor + const PanTiltCam + const PanTiltCam2K + const Plug + const PlugMiniJP + const PlugMiniUS + const RobotVacuumCleanerS1 + const RobotVacuumCleanerS1Plus + const SmartFan + const StripLight + type PlugMiniJPEvent struct + Context PlugMiniJPEventContext + EventType string + EventVersion string + type PlugMiniJPEventContext struct + DeviceMac string + DeviceType string + PowerState PowerState + TimeOfSample int64 + type PlugMiniUSEvent struct + Context PlugMiniUSEventContext + EventType string + EventVersion string + type PlugMiniUSEventContext struct + DeviceMac string + DeviceType string + PowerState PowerState + TimeOfSample int64 + type PowerState string + const PowerOff + const PowerOn + func (power PowerState) ToLower() string + type Scene struct + ID string + Name string + type SceneService struct + func (svc *SceneService) Execute(ctx context.Context, id string) error + func (svc *SceneService) List(ctx context.Context) ([]Scene, error) + type SetPositionMode int + const DefaultMode + const PerformanceMode + const SilentMode + type SmartFanMode int + const NaturalFanMode + const StandardFanMode + type StripLightEvent struct + Context StripLightEventContext + EventType string + EventVersion string + type StripLightEventContext struct + Brightness int + Color string + DeviceMac string + DeviceType string + PowerState PowerState + TimeOfSample int64 + type SweeperEvent struct + Context SweeperEventContext + EventType string + EventVersion string + type SweeperEventContext struct + Battery int + DeviceMac string + DeviceType string + OnlineStatus CleanerOnlineStatus + TimeOfSample int64 + WorkingStatus CleanerWorkingStatus + type VacuumPowerLevel int + const MaxVacuumPowerLevel + const QuietVacuumPowerLevel + const StandardVacuumPowerLevel + const StrongVacuumPowerLevel + type VirtualDeviceType string + const AirConditioner + const AirPurifier + const Camera + const DVD + const Fan + const IPTVStreamer + const Light + const Others + const Projector + const SetTopBox + const Speaker + const TV + const VacuumCleaner + const WaterHeater + type WebhookQueryActionType string + const QueryDetails + const QueryURL + type WebhookService struct + func (svc *WebhookService) Delete(ctx context.Context, url string) (io.ReadCloser, error) + func (svc *WebhookService) Query(ctx context.Context, action WebhookQueryActionType, url string) (io.ReadCloser, error) + func (svc *WebhookService) Setup(ctx context.Context, url, deviceList string) error + func (svc *WebhookService) Update(ctx context.Context, url string, enable bool) (io.ReadCloser, error)