switchbot

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2025 License: MIT Imports: 16 Imported by: 2

README

SwitchBot API in Go

Go Reference Go Report Card Coverage Code to Test Ratio Test Execution Time

日本語はこちら

A Golang library for the SwitchBot API v1.1.

Each device has a dedicated struct that exposes only the APIs available for that specific device.
This design promotes both safety and simplicity for users.

Support Feature

  • Devices
    • ✅️ Get device list
    • ✅ Get device status
    • ✅ Send device control command
      • ✅ Physical devices
      • ✅ Virtual infrared remote devices
  • Scenes
    • ❌ Get scene list
    • ❌ Execute manual scenes
  • Webhooks
    • ❌ Configure webhook
    • ❌ Get webhook configuration
    • ❌ Update webhook configuration
    • ❌ Delete webhook
    • ❌ Receive events from webhook

Installing

$ go get github.com/yasu89/switch-bot-api-go

Current Support Status (2025/06/18)

  • A ✅ in the “Verification” column indicates that the feature has been tested and verified using an actual device.
Physical Devices
Device Struct Definition Get Status Send Command Verification
Bot
Curtain
Curtain 3
Hub ✅️ - -
Hub Plus - -
Hub Mini - -
Hub 2 -
Hub 3 -
Meter -
Meter Plus -
Outdoor Meter -
Meter Pro -
Meter Pro CO2 -
Lock
Lock Pro
Lock Ultra
Keypad
Keypad Touch
Remote - -
Motion Sensor -
Contact Sensor -
Water Leak Detector -
Ceiling Light
Ceiling Light Pro
Plug Mini (US)
Plug Mini (JP)
Plug
Strip Light
Color Bulb
Robot Vacuum Cleaner S1
Robot Vacuum Cleaner S1 Plus
Mini Robot Vacuum K10+
Mini Robot Vacuum K10+ Pro
K10+ Pro Combo
Floor Cleaning Robot S10
Floor Cleaning Robot S20
Multitasking Household Robot K20+ Pro
Humidifier
Evaporative Humidifier
Evaporative Humidifier (Auto-refill)
Air Purifier VOC
Air Purifier Table VOC
Air Purifier PM2.5
Air Purifier Table PM2.5
Indoor Cam - -
Pan/Tilt Cam - -
Pan/Tilt Cam 2K - -
Blind Tilt
Battery Circulator Fan
Circulator Fan
Roller Shade
Relay Switch 1PM
Relay Switch 1
Relay Switch 2PM
Garage Door Opener
Floor Lamp
LED Strip Light 3
Lock Lite
Video Doorbell
Keypad Vision
Virtual Infrared Remote Devices
Virtual Infrared Remote Device Struct Definition Send Command Verification
Air Conditioner
TV
Light
Streamer
Set Top Box
DVD Player
Fan
Projector
Camera
Air Purifier
Speaker
Water Heater
Robot Vacuum Cleaner
Others

Documentation

Index

Constants

View Source
const (
	RobotVacuumCleanerPowerLevelQuiet    = RobotVacuumCleanerPowerLevel(0)
	RobotVacuumCleanerPowerLevelStandard = RobotVacuumCleanerPowerLevel(1)
	RobotVacuumCleanerPowerLevelStrong   = RobotVacuumCleanerPowerLevel(2)
	RobotVacuumCleanerPowerLevelMax      = RobotVacuumCleanerPowerLevel(3)
)
View Source
const (
	WashMopSelfCleaningMode   = SelfCleaningMode(1)
	DrySelfCleaningMode       = SelfCleaningMode(2)
	TerminateSelfCleaningMode = SelfCleaningMode(3)
)
View Source
const (
	HumidifierModeAuto   = HumidifierMode(0)
	HumidifierModeLow    = HumidifierMode(101)
	HumidifierModeMedium = HumidifierMode(102)
	HumidifierModeHigh   = HumidifierMode(103)
)
View Source
const (
	EvaporativeHumidifierModeLevel4   = EvaporativeHumidifierMode(1)
	EvaporativeHumidifierModeLevel3   = EvaporativeHumidifierMode(2)
	EvaporativeHumidifierModeLevel2   = EvaporativeHumidifierMode(3)
	EvaporativeHumidifierModeLevel1   = EvaporativeHumidifierMode(4)
	EvaporativeHumidifierModeHumidity = EvaporativeHumidifierMode(5)
	EvaporativeHumidifierModeSleep    = EvaporativeHumidifierMode(6)
	EvaporativeHumidifierModeAuto     = EvaporativeHumidifierMode(7)
	EvaporativeHumidifierModeDry      = EvaporativeHumidifierMode(8)
)
View Source
const (
	AirPurifierModeNormal = AirPurifierMode(1)
	AirPurifierModeAuto   = AirPurifierMode(2)
	AirPurifierModeSleep  = AirPurifierMode(3)
	AirPurifierModePet    = AirPurifierMode(4)
)
View Source
const (
	CirculatorNightLightModeTurnOff    = CirculatorNightLightMode("off")
	CirculatorNightLightModeTurnBright = CirculatorNightLightMode("1")
	CirculatorNightLightModeTurnDim    = CirculatorNightLightMode("2")
)
View Source
const (
	CirculatorWindModeDirect  = CirculatorWindMode("direct")
	CirculatorWindModeNatural = CirculatorWindMode("natural")
	CirculatorWindModeSleep   = CirculatorWindMode("sleep")
	CirculatorWindModeBaby    = CirculatorWindMode("baby")
)
View Source
const (
	RelaySwitchModeToggle    = RelaySwitchMode(0)
	RelaySwitchModeEdge      = RelaySwitchMode(1)
	RelaySwitchModeDetached  = RelaySwitchMode(2)
	RelaySwitchModeMomentary = RelaySwitchMode(3)
)
View Source
const (
	AirConditionerModeAuto      = AirConditionerMode(1)
	AirConditionerModeCool      = AirConditionerMode(2)
	AirConditionerModeDry       = AirConditionerMode(3)
	AirConditionerModeFan       = AirConditionerMode(4)
	AirConditionerModeHeat      = AirConditionerMode(5)
	AirConditionerFanModeAuto   = AirConditionerFanMode(1)
	AirConditionerFanModeLow    = AirConditionerFanMode(2)
	AirConditionerFanModeMedium = AirConditionerFanMode(3)
	AirConditionerFanModeHigh   = AirConditionerFanMode(4)
	AirConditionerPowerStateOn  = AirConditionerPowerState("on")
	AirConditionerPowerStateOff = AirConditionerPowerState("off")
)
View Source
const (
	DefaultBaseApiURL = "https://api.switch-bot.com/v1.1"
)

Variables

This section is empty.

Functions

func OptionBaseApiURL added in v0.3.3

func OptionBaseApiURL(baseApiURL string) func(*Client)

func OptionDebug

func OptionDebug(debugFlag bool) func(*Client)

Types

type AirConditionerFanMode added in v0.3.0

type AirConditionerFanMode int

type AirConditionerMode added in v0.3.0

type AirConditionerMode int

type AirConditionerPowerState added in v0.3.0

type AirConditionerPowerState string

type AirPurifierDevice added in v0.3.2

type AirPurifierDevice struct {
	CommonDeviceListItem
}

func (*AirPurifierDevice) ExecCommand added in v0.4.0

func (device *AirPurifierDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the AirPurifierDevice

func (*AirPurifierDevice) GetAnyStatusBody added in v0.3.5

func (device *AirPurifierDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*AirPurifierDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *AirPurifierDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the AirPurifierDevice command parameter

func (*AirPurifierDevice) GetStatus added in v0.3.2

func (*AirPurifierDevice) SetChildLock added in v0.3.2

func (device *AirPurifierDevice) SetChildLock(flag bool) (*CommonResponse, error)

SetChildLock sends a command to set the child lock of the AirPurifierDevice

func (*AirPurifierDevice) SetMode added in v0.3.2

func (device *AirPurifierDevice) SetMode(mode AirPurifierMode, fanLevel int) (*CommonResponse, error)

SetMode sends a command to set the mode of the AirPurifierDevice

func (*AirPurifierDevice) TurnOff added in v0.3.2

func (device *AirPurifierDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the AirPurifierDevice

func (*AirPurifierDevice) TurnOn added in v0.3.2

func (device *AirPurifierDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the AirPurifierDevice

type AirPurifierDeviceCommandParameter added in v0.4.0

type AirPurifierDeviceCommandParameter struct {
	Command   string `` /* 205-byte string literal not displayed */
	Mode      int    `json:"mode" title:"Mode" minimum:"1" maximum:"4" description:"1:Normal mode, 2:Auto mode, 3:Sleep mode, 4:Manual mode"`
	FanLevel  int    `json:"fanLevel" title:"FanLevel" minimum:"1" maximum:"3" description:"Fan speed level (1-3) for Normal mode"`
	ChildLock bool   `json:"childLock" title:"ChildLock" description:"true:lock, false:unlock"`
	// contains filtered or unexported fields
}

AirPurifierDeviceCommandParameter is a struct that represents the command parameter for the AirPurifierDevice

func (*AirPurifierDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *AirPurifierDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the AirPurifierDevice command parameter

type AirPurifierDeviceCommandSetChildLockIfExposer added in v0.4.0

type AirPurifierDeviceCommandSetChildLockIfExposer struct{}

AirPurifierDeviceCommandSetChildLockIfExposer represents the SetChildLock command parameters

func (*AirPurifierDeviceCommandSetChildLockIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *AirPurifierDeviceCommandSetChildLockIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the AirPurifierDevice command parameter for SetChildLock

func (*AirPurifierDeviceCommandSetChildLockIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *AirPurifierDeviceCommandSetChildLockIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the AirPurifierDevice command parameter for SetChildLock

type AirPurifierDeviceCommandSetModeIfExposer added in v0.4.0

type AirPurifierDeviceCommandSetModeIfExposer struct{}

AirPurifierDeviceCommandSetModeIfExposer represents the SetMode command parameters

func (*AirPurifierDeviceCommandSetModeIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *AirPurifierDeviceCommandSetModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the AirPurifierDevice command parameter for SetMode

func (*AirPurifierDeviceCommandSetModeIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *AirPurifierDeviceCommandSetModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the AirPurifierDevice command parameter for SetMode

type AirPurifierDeviceCommandSetNormalModeIfExposer added in v0.4.0

type AirPurifierDeviceCommandSetNormalModeIfExposer struct{}

AirPurifierDeviceCommandSetNormalModeIfExposer represents the SetMode off NormalMode command parameters

func (*AirPurifierDeviceCommandSetNormalModeIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *AirPurifierDeviceCommandSetNormalModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the AirPurifierDevice command parameter for SetMode

func (*AirPurifierDeviceCommandSetNormalModeIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *AirPurifierDeviceCommandSetNormalModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the AirPurifierDevice command parameter for SetMode

type AirPurifierDeviceStatusBody added in v0.3.2

type AirPurifierDeviceStatusBody struct {
	CommonDevice
	Power     string `json:"power"`
	Version   string `json:"version"`
	Mode      int    `json:"mode"`
	ChildLock bool   `json:"childLock"`
}

type AirPurifierDeviceStatusResponse added in v0.3.2

type AirPurifierDeviceStatusResponse struct {
	CommonResponse
	Body *AirPurifierDeviceStatusBody `json:"body"`
}

type AirPurifierMode added in v0.3.2

type AirPurifierMode int

type AirPurifierModeParameter added in v0.3.2

type AirPurifierModeParameter struct {
	Mode    AirPurifierMode `json:"mode"`
	FanGear int             `json:"fanGear,omitempty"`
}

type BatteryCirculatorFanDevice added in v0.3.2

type BatteryCirculatorFanDevice struct {
	CommonDeviceListItem
}

func (*BatteryCirculatorFanDevice) ExecCommand added in v0.4.0

func (device *BatteryCirculatorFanDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the BatteryCirculatorFanDevice

func (*BatteryCirculatorFanDevice) GetAnyStatusBody added in v0.3.5

func (device *BatteryCirculatorFanDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*BatteryCirculatorFanDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *BatteryCirculatorFanDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the BatteryCirculatorFanDevice command parameter

func (*BatteryCirculatorFanDevice) GetStatus added in v0.3.2

func (*BatteryCirculatorFanDevice) SetNightLightMode added in v0.3.2

func (device *BatteryCirculatorFanDevice) SetNightLightMode(mode CirculatorNightLightMode) (*CommonResponse, error)

SetNightLightMode sends a command to set the night light mode of the BatteryCirculatorFanDevice

func (*BatteryCirculatorFanDevice) SetWindMode added in v0.3.2

func (device *BatteryCirculatorFanDevice) SetWindMode(mode CirculatorWindMode) (*CommonResponse, error)

SetWindMode sends a command to set the wind mode of the BatteryCirculatorFanDevice

func (*BatteryCirculatorFanDevice) SetWindSpeed added in v0.3.2

func (device *BatteryCirculatorFanDevice) SetWindSpeed(speed int) (*CommonResponse, error)

SetWindSpeed sends a command to set the wind speed of the BatteryCirculatorFanDevice

func (*BatteryCirculatorFanDevice) TurnOff added in v0.3.2

func (device *BatteryCirculatorFanDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the BatteryCirculatorFanDevice

func (*BatteryCirculatorFanDevice) TurnOn added in v0.3.2

func (device *BatteryCirculatorFanDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the BatteryCirculatorFanDevice

type BatteryCirculatorFanDeviceStatusBody added in v0.3.2

type BatteryCirculatorFanDeviceStatusBody struct {
	CommonDevice
	Mode                string `json:"mode"`
	Version             string `json:"version"`
	Battery             int    `json:"battery"`
	Power               string `json:"power"`
	NightStatus         string `json:"nightStatus"`
	Oscillation         string `json:"oscillation"`
	VerticalOscillation string `json:"verticalOscillation"`
	ChargingStatus      string `json:"chargingStatus"`
	FanSpeed            int    `json:"fanSpeed"`
}

type BatteryCirculatorFanDeviceStatusResponse added in v0.3.2

type BatteryCirculatorFanDeviceStatusResponse struct {
	CommonResponse
	Body *BatteryCirculatorFanDeviceStatusBody `json:"body"`
}

type BlindTiltDevice added in v0.3.2

type BlindTiltDevice struct {
	CommonDeviceListItem
	Version             int      `json:"version"`
	BlindTiltDevicesIds []string `json:"blindTiltDevicesIds"`
	Calibrate           bool     `json:"calibrate"`
	Group               bool     `json:"group"`
	Master              bool     `json:"master"`
	Direction           string   `json:"direction"`
	SlidePosition       int      `json:"slidePosition"`
}

func (*BlindTiltDevice) CloseDown added in v0.3.2

func (device *BlindTiltDevice) CloseDown() (*CommonResponse, error)

CloseDown sends a command to close down the BlindTiltDevice

func (*BlindTiltDevice) CloseUp added in v0.3.2

func (device *BlindTiltDevice) CloseUp() (*CommonResponse, error)

CloseUp sends a command to close up the BlindTiltDevice

func (*BlindTiltDevice) ExecCommand added in v0.4.0

func (device *BlindTiltDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the BlindTiltDevice

func (*BlindTiltDevice) FullyOpen added in v0.3.2

func (device *BlindTiltDevice) FullyOpen() (*CommonResponse, error)

FullyOpen sends a command to fully open the BlindTiltDevice

func (*BlindTiltDevice) GetAnyStatusBody added in v0.3.5

func (device *BlindTiltDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*BlindTiltDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *BlindTiltDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the BlindTiltDevice command parameter

func (*BlindTiltDevice) GetStatus added in v0.3.2

func (device *BlindTiltDevice) GetStatus() (*BlindTiltDeviceStatusResponse, error)

func (*BlindTiltDevice) SetPosition added in v0.3.2

func (device *BlindTiltDevice) SetPosition(direction string, position int) (*CommonResponse, error)

SetPosition sends a command to set the position of the BlindTiltDevice

type BlindTiltDeviceCommandParameter added in v0.4.0

type BlindTiltDeviceCommandParameter struct {
	Command   string `` /* 241-byte string literal not displayed */
	Direction string `json:"direction" title:"Direction" enum:"up,down" description:"Direction of the blind (up or down)"`
	Position  int    `json:"position" title:"Position" minimum:"0" maximum:"100" description:"Position value (0-100, must be even number)"`
	// contains filtered or unexported fields
}

BlindTiltDeviceCommandParameter is a struct that represents the command parameter for the BlindTiltDevice

func (*BlindTiltDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *BlindTiltDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the BlindTiltDevice command parameter

type BlindTiltDeviceCommandSetPositionIfExposer added in v0.4.0

type BlindTiltDeviceCommandSetPositionIfExposer struct{}

BlindTiltDeviceCommandSetPositionIfExposer represents the SetPosition command parameters

func (*BlindTiltDeviceCommandSetPositionIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *BlindTiltDeviceCommandSetPositionIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the BlindTiltDevice command parameter for SetPosition

func (*BlindTiltDeviceCommandSetPositionIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *BlindTiltDeviceCommandSetPositionIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the BlindTiltDevice command parameter for SetPosition

type BlindTiltDeviceStatusBody added in v0.3.2

type BlindTiltDeviceStatusBody struct {
	CommonDevice
	Version       int    `json:"version"`
	Calibrate     bool   `json:"calibrate"`
	Group         bool   `json:"group"`
	Moving        bool   `json:"moving"`
	Direction     string `json:"direction"`
	SlidePosition int    `json:"slidePosition"`
}

type BlindTiltDeviceStatusResponse added in v0.3.2

type BlindTiltDeviceStatusResponse struct {
	CommonResponse
	Body *BlindTiltDeviceStatusBody `json:"body"`
}

type BotDevice

type BotDevice struct {
	CommonDeviceListItem
}

func (*BotDevice) ExecCommand added in v0.4.0

func (device *BotDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the BotDevice

func (*BotDevice) GetAnyStatusBody added in v0.3.5

func (device *BotDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*BotDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *BotDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the BotDevice command parameter

func (*BotDevice) GetStatus added in v0.2.0

func (device *BotDevice) GetStatus() (*BotDeviceStatusResponse, error)

func (*BotDevice) Press added in v0.2.0

func (device *BotDevice) Press() (*CommonResponse, error)

Press sends a command to press the BotDevice

func (*BotDevice) TurnOff added in v0.2.0

func (device *BotDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the BotDevice

func (*BotDevice) TurnOn added in v0.2.0

func (device *BotDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the BotDevice

type BotDeviceCommandParameter added in v0.4.0

type BotDeviceCommandParameter struct {
	Command string `` /* 158-byte string literal not displayed */
	// contains filtered or unexported fields
}

BotDeviceCommandParameter is a struct that represents the command parameter for the BotDevice

type BotDeviceStatusBody added in v0.2.0

type BotDeviceStatusBody struct {
	CommonDevice
	Power      string `json:"power"`
	Battery    int    `json:"battery"`
	Version    string `json:"version"`
	DeviceMode string `json:"deviceMode"`
}

type BotDeviceStatusResponse added in v0.2.0

type BotDeviceStatusResponse struct {
	CommonResponse
	Body *BotDeviceStatusBody `json:"body"`
}

type CeilingLightDevice added in v0.3.2

type CeilingLightDevice struct {
	CommonDeviceListItem
}

func (*CeilingLightDevice) ExecCommand added in v0.4.0

func (device *CeilingLightDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the CeilingLightDevice

func (*CeilingLightDevice) GetAnyStatusBody added in v0.3.5

func (device *CeilingLightDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*CeilingLightDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *CeilingLightDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the CeilingLightDevice command parameter

func (*CeilingLightDevice) GetStatus added in v0.3.2

func (*CeilingLightDevice) SetBrightness added in v0.3.2

func (device *CeilingLightDevice) SetBrightness(brightness int) (*CommonResponse, error)

SetBrightness sends a command to set the brightness of the CeilingLightDevice

func (*CeilingLightDevice) SetColorTemperature added in v0.3.2

func (device *CeilingLightDevice) SetColorTemperature(colorTemperature int) (*CommonResponse, error)

SetColorTemperature sends a command to set the color temperature of the CeilingLightDevice

func (*CeilingLightDevice) Toggle added in v0.3.2

func (device *CeilingLightDevice) Toggle() (*CommonResponse, error)

Toggle sends a command to toggle the CeilingLightDevice

func (*CeilingLightDevice) TurnOff added in v0.3.2

func (device *CeilingLightDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the CeilingLightDevice

func (*CeilingLightDevice) TurnOn added in v0.3.2

func (device *CeilingLightDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the CeilingLightDevice

type CeilingLightDeviceCommandParameter added in v0.4.0

type CeilingLightDeviceCommandParameter struct {
	Command          string `` /* 298-byte string literal not displayed */
	Brightness       int    `json:"brightness" title:"Brightness" minimum:"1" maximum:"100" description:"Brightness level (1-100)"`
	ColorTemperature int    `` /* 132-byte string literal not displayed */
	// contains filtered or unexported fields
}

CeilingLightDeviceCommandParameter is a struct that represents the command parameter for the CeilingLightDevice

func (*CeilingLightDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *CeilingLightDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the CeilingLightDevice command parameter

type CeilingLightDeviceCommandSetBrightnessIfExposer added in v0.4.0

type CeilingLightDeviceCommandSetBrightnessIfExposer struct{}

CeilingLightDeviceCommandSetBrightnessIfExposer represents the SetBrightness command parameters

func (*CeilingLightDeviceCommandSetBrightnessIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *CeilingLightDeviceCommandSetBrightnessIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the CeilingLightDevice command parameter for SetBrightness

func (*CeilingLightDeviceCommandSetBrightnessIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *CeilingLightDeviceCommandSetBrightnessIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the CeilingLightDevice command parameter for SetBrightness

type CeilingLightDeviceCommandSetColorTemperatureIfExposer added in v0.4.0

type CeilingLightDeviceCommandSetColorTemperatureIfExposer struct{}

CeilingLightDeviceCommandSetColorTemperatureIfExposer represents the SetColorTemperature command parameters

func (*CeilingLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *CeilingLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the CeilingLightDevice command parameter for SetColorTemperature

func (*CeilingLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *CeilingLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the CeilingLightDevice command parameter for SetColorTemperature

type CeilingLightDeviceStatusBody added in v0.3.2

type CeilingLightDeviceStatusBody struct {
	CommonDevice
	Power            string `json:"power"`
	Version          string `json:"version"`
	Brightness       int    `json:"brightness"`
	ColorTemperature int    `json:"colorTemperature"`
}

type CeilingLightDeviceStatusResponse added in v0.3.2

type CeilingLightDeviceStatusResponse struct {
	CommonResponse
	Body *CeilingLightDeviceStatusBody `json:"body"`
}

type CirculatorFanDevice added in v0.3.2

type CirculatorFanDevice struct {
	CommonDeviceListItem
}

func (*CirculatorFanDevice) ExecCommand added in v0.4.0

func (device *CirculatorFanDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the CirculatorFanDevice

func (*CirculatorFanDevice) GetAnyStatusBody added in v0.3.5

func (device *CirculatorFanDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*CirculatorFanDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *CirculatorFanDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the CirculatorFanDevice command parameter

func (*CirculatorFanDevice) GetStatus added in v0.3.2

func (*CirculatorFanDevice) SetNightLightMode added in v0.3.2

func (device *CirculatorFanDevice) SetNightLightMode(mode CirculatorNightLightMode) (*CommonResponse, error)

SetNightLightMode sends a command to set the night light mode of the CirculatorFanDevice

func (*CirculatorFanDevice) SetWindMode added in v0.3.2

func (device *CirculatorFanDevice) SetWindMode(mode CirculatorWindMode) (*CommonResponse, error)

SetWindMode sends a command to set the wind mode of the CirculatorFanDevice

func (*CirculatorFanDevice) SetWindSpeed added in v0.3.2

func (device *CirculatorFanDevice) SetWindSpeed(speed int) (*CommonResponse, error)

SetWindSpeed sends a command to set the wind speed of the CirculatorFanDevice

func (*CirculatorFanDevice) TurnOff added in v0.3.2

func (device *CirculatorFanDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the CirculatorFanDevice

func (*CirculatorFanDevice) TurnOn added in v0.3.2

func (device *CirculatorFanDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the CirculatorFanDevice

type CirculatorFanDeviceCommandParameter added in v0.4.0

type CirculatorFanDeviceCommandParameter struct {
	Command    string `` /* 268-byte string literal not displayed */
	NightLight string `json:"nightLight" title:"NightLight" enum:"off,1,2" description:"Night light mode: off:turn off, 1:bright, 2:dim"`
	WindMode   string `` /* 172-byte string literal not displayed */
	WindSpeed  int    `json:"windSpeed" title:"WindSpeed" minimum:"1" maximum:"100" description:"Wind speed (1-100)"`
	// contains filtered or unexported fields
}

CirculatorFanDeviceCommandParameter is a struct that represents the command parameter for the BatteryCirculatorFanDevice and CirculatorFanDevice

func (*CirculatorFanDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *CirculatorFanDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the BatteryCirculatorFanDevice and CirculatorFanDevice command parameter

type CirculatorFanDeviceCommandSetNightLightModeIfExposer added in v0.4.0

type CirculatorFanDeviceCommandSetNightLightModeIfExposer struct{}

CirculatorFanDeviceCommandSetNightLightModeIfExposer represents the SetNightLightMode command parameters

func (*CirculatorFanDeviceCommandSetNightLightModeIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *CirculatorFanDeviceCommandSetNightLightModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the BatteryCirculatorFanDevice and CirculatorFanDevice command parameter for SetNightLightMode

func (*CirculatorFanDeviceCommandSetNightLightModeIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *CirculatorFanDeviceCommandSetNightLightModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the BatteryCirculatorFanDevice and CirculatorFanDevice command parameter for SetNightLightMode

type CirculatorFanDeviceCommandSetWindModeIfExposer added in v0.4.0

type CirculatorFanDeviceCommandSetWindModeIfExposer struct{}

CirculatorFanDeviceCommandSetWindModeIfExposer represents the SetWindMode command parameters

func (*CirculatorFanDeviceCommandSetWindModeIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *CirculatorFanDeviceCommandSetWindModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the BatteryCirculatorFanDevice and CirculatorFanDevice command parameter for SetWindMode

func (*CirculatorFanDeviceCommandSetWindModeIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *CirculatorFanDeviceCommandSetWindModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the BatteryCirculatorFanDevice and CirculatorFanDevice command parameter for SetWindMode

type CirculatorFanDeviceCommandSetWindSpeedIfExposer added in v0.4.0

type CirculatorFanDeviceCommandSetWindSpeedIfExposer struct{}

CirculatorFanDeviceCommandSetWindSpeedIfExposer represents the SetWindSpeed command parameters

func (*CirculatorFanDeviceCommandSetWindSpeedIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *CirculatorFanDeviceCommandSetWindSpeedIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the BatteryCirculatorFanDevice and CirculatorFanDevice command parameter for SetWindSpeed

func (*CirculatorFanDeviceCommandSetWindSpeedIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *CirculatorFanDeviceCommandSetWindSpeedIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the BatteryCirculatorFanDevice and CirculatorFanDevice command parameter for SetWindSpeed

type CirculatorFanDeviceStatusBody added in v0.3.2

type CirculatorFanDeviceStatusBody struct {
	CommonDevice
	Mode                string `json:"mode"`
	Version             string `json:"version"`
	Power               string `json:"power"`
	NightStatus         string `json:"nightStatus"`
	Oscillation         string `json:"oscillation"`
	VerticalOscillation string `json:"verticalOscillation"`
	FanSpeed            int    `json:"fanSpeed"`
}

type CirculatorFanDeviceStatusResponse added in v0.3.2

type CirculatorFanDeviceStatusResponse struct {
	CommonResponse
	Body *CirculatorFanDeviceStatusBody `json:"body"`
}

type CirculatorNightLightMode added in v0.3.2

type CirculatorNightLightMode string

type CirculatorWindMode added in v0.3.2

type CirculatorWindMode string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(secret string, token string, options ...Option) *Client

func (*Client) GetDevices

func (client *Client) GetDevices() (*GetDevicesResponse, error)

func (*Client) GetRequest

func (client *Client) GetRequest(path string, parser ResponseParser) error

func (*Client) PostRequest added in v0.2.0

func (client *Client) PostRequest(path string, request ControlRequest) (*CommonResponse, error)

func (*Client) SendCommand added in v0.2.0

func (client *Client) SendCommand(deviceId string, request ControlRequest) (*CommonResponse, error)

type ColorLightDevice added in v0.5.0

type ColorLightDevice struct {
	CommonDeviceListItem
}

func (*ColorLightDevice) ExecCommand added in v0.5.0

func (device *ColorLightDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the ColorLightDevice

func (*ColorLightDevice) GetAnyStatusBody added in v0.5.0

func (device *ColorLightDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*ColorLightDevice) GetCommandParameterJSONSchema added in v0.5.0

func (device *ColorLightDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the ColorLightDevice command parameter

func (*ColorLightDevice) GetStatus added in v0.5.0

func (device *ColorLightDevice) GetStatus() (*ColorLightDeviceStatusResponse, error)

func (*ColorLightDevice) SetBrightness added in v0.5.0

func (device *ColorLightDevice) SetBrightness(brightness int) (*CommonResponse, error)

SetBrightness sends a command to set the brightness of the ColorLightDevice

func (*ColorLightDevice) SetColor added in v0.5.0

func (device *ColorLightDevice) SetColor(color color.RGBA) (*CommonResponse, error)

SetColor sends a command to set the color of the ColorLightDevice

func (*ColorLightDevice) SetColorTemperature added in v0.5.0

func (device *ColorLightDevice) SetColorTemperature(colorTemperature int) (*CommonResponse, error)

SetColorTemperature sends a command to set the color temperature of the ColorLightDevice

func (*ColorLightDevice) Toggle added in v0.5.0

func (device *ColorLightDevice) Toggle() (*CommonResponse, error)

Toggle sends a command to toggle the ColorLightDevice

func (*ColorLightDevice) TurnOff added in v0.5.0

func (device *ColorLightDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the ColorLightDevice

func (*ColorLightDevice) TurnOn added in v0.5.0

func (device *ColorLightDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the ColorLightDevice

type ColorLightDeviceCommandParameter added in v0.5.0

type ColorLightDeviceCommandParameter struct {
	Command          string `` /* 303-byte string literal not displayed */
	Brightness       int    `json:"brightness" title:"Brightness" minimum:"1" maximum:"100" description:"Brightness level (1-100)"`
	Red              int    `json:"red" title:"Red" minimum:"0" maximum:"255" description:"Red color value (0-255)"`
	Green            int    `json:"green" title:"Green" minimum:"0" maximum:"255" description:"Green color value (0-255)"`
	Blue             int    `json:"blue" title:"Blue" minimum:"0" maximum:"255" description:"Blue color value (0-255)"`
	ColorTemperature int    `` /* 132-byte string literal not displayed */
	// contains filtered or unexported fields
}

ColorLightDeviceCommandParameter is a struct that represents the command parameter for the ColorLightDevice

func (*ColorLightDeviceCommandParameter) JSONSchemaAllOf added in v0.5.0

func (parameter *ColorLightDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the ColorLightDevice command parameter

type ColorLightDeviceCommandSetBrightnessIfExposer added in v0.5.0

type ColorLightDeviceCommandSetBrightnessIfExposer struct{}

ColorLightDeviceCommandSetBrightnessIfExposer represents the SetBrightness command parameters

func (*ColorLightDeviceCommandSetBrightnessIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *ColorLightDeviceCommandSetBrightnessIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the ColorLightDevice command parameter for SetBrightness

func (*ColorLightDeviceCommandSetBrightnessIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *ColorLightDeviceCommandSetBrightnessIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the ColorLightDevice command parameter for SetBrightness

type ColorLightDeviceCommandSetColorIfExposer added in v0.5.0

type ColorLightDeviceCommandSetColorIfExposer struct{}

ColorLightDeviceCommandSetColorIfExposer represents the SetColor command parameters

func (*ColorLightDeviceCommandSetColorIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *ColorLightDeviceCommandSetColorIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the ColorLightDevice command parameter for SetColor

func (*ColorLightDeviceCommandSetColorIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *ColorLightDeviceCommandSetColorIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the ColorLightDevice command parameter for SetColor

type ColorLightDeviceCommandSetColorTemperatureIfExposer added in v0.5.0

type ColorLightDeviceCommandSetColorTemperatureIfExposer struct{}

ColorLightDeviceCommandSetColorTemperatureIfExposer represents the SetColorTemperature command parameters

func (*ColorLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *ColorLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the ColorLightDevice command parameter for SetColorTemperature

func (*ColorLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *ColorLightDeviceCommandSetColorTemperatureIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the ColorLightDevice command parameter for SetColorTemperature

type ColorLightDeviceStatusBody added in v0.5.0

type ColorLightDeviceStatusBody struct {
	CommonDevice
	Power            string `json:"power"`
	Brightness       int    `json:"brightness"`
	Version          string `json:"version"`
	Color            string `json:"color"`
	ColorTemperature int    `json:"colorTemperature"`
}

type ColorLightDeviceStatusResponse added in v0.5.0

type ColorLightDeviceStatusResponse struct {
	CommonResponse
	Body *ColorLightDeviceStatusBody `json:"body"`
}

type CommonDevice

type CommonDevice struct {
	DeviceID    string `json:"deviceId"`
	DeviceType  string `json:"deviceType"`
	HubDeviceId string `json:"hubDeviceId"`
}

func (*CommonDevice) GetDeviceID added in v0.3.6

func (device *CommonDevice) GetDeviceID() string

type CommonDeviceListItem

type CommonDeviceListItem struct {
	CommonDevice
	Client             *Client
	DeviceName         string `json:"deviceName"`
	EnableCloudService bool   `json:"enableCloudService"`
}

type CommonResponse

type CommonResponse struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
}

type ContactSensorDevice added in v0.3.2

type ContactSensorDevice struct {
	CommonDeviceListItem
}

func (*ContactSensorDevice) GetAnyStatusBody added in v0.3.5

func (device *ContactSensorDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*ContactSensorDevice) GetStatus added in v0.3.2

type ContactSensorDeviceStatusBody added in v0.3.2

type ContactSensorDeviceStatusBody struct {
	CommonDevice
	Battery      int    `json:"battery"`
	Version      string `json:"version"`
	MoveDetected bool   `json:"moveDetected"`
	OpenState    string `json:"openState"`
	Brightness   string `json:"brightness"`
}

type ContactSensorDeviceStatusResponse added in v0.3.2

type ContactSensorDeviceStatusResponse struct {
	CommonResponse
	Body *ContactSensorDeviceStatusBody `json:"body"`
}

type ControlRequest added in v0.2.0

type ControlRequest struct {
	Command     string      `json:"command"`
	Parameter   interface{} `json:"parameter"`
	CommandType string      `json:"commandType"`
}

type CurtainDevice added in v0.2.0

type CurtainDevice struct {
	CommonDeviceListItem
	CurtainDevicesIds []string `json:"curtainDevicesIds"`
	Calibrate         bool     `json:"calibrate"`
	Group             bool     `json:"group"`
	Master            bool     `json:"master"`
	OpenDirection     string   `json:"openDirection"`
}

func (*CurtainDevice) ExecCommand added in v0.4.0

func (device *CurtainDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the CurtainDevice

func (*CurtainDevice) GetAnyStatusBody added in v0.3.5

func (device *CurtainDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*CurtainDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *CurtainDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the CurtainDevice command parameter

func (*CurtainDevice) GetStatus added in v0.3.2

func (device *CurtainDevice) GetStatus() (*CurtainDeviceStatusResponse, error)

func (*CurtainDevice) Pause added in v0.2.0

func (device *CurtainDevice) Pause() (*CommonResponse, error)

Pause sends a command to pause the CurtainDevice

func (*CurtainDevice) SetPosition added in v0.2.0

func (device *CurtainDevice) SetPosition(mode CurtainPositionMode, position int) (*CommonResponse, error)

SetPosition sends a command to set the position of the CurtainDevice

func (*CurtainDevice) TurnOff added in v0.2.0

func (device *CurtainDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the CurtainDevice

func (*CurtainDevice) TurnOn added in v0.2.0

func (device *CurtainDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the CurtainDevice

type CurtainDeviceCommandParameter added in v0.4.0

type CurtainDeviceCommandParameter struct {
	Command  string `` /* 234-byte string literal not displayed */
	Mode     string `json:"mode" title:"Mode" enum:"0,1,ff" description:"0:performance mode, 1:silent mode, ff:default mode"`
	Position int    `json:"position" title:"Position" minimum:"0" maximum:"100"`
	// contains filtered or unexported fields
}

CurtainDeviceCommandParameter is a struct that represents the command parameter for the CurtainDevice

func (*CurtainDeviceCommandParameter) JSONSchemaIf added in v0.4.0

func (parameter *CurtainDeviceCommandParameter) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the CurtainDevice command parameter

func (*CurtainDeviceCommandParameter) JSONSchemaThen added in v0.4.0

func (parameter *CurtainDeviceCommandParameter) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the CurtainDevice command parameter

type CurtainDeviceStatusBody added in v0.3.2

type CurtainDeviceStatusBody struct {
	CommonDevice
	Calibrate     bool   `json:"calibrate"`
	Group         bool   `json:"group"`
	Moving        bool   `json:"moving"`
	Battery       int    `json:"battery"`
	Version       string `json:"version"`
	SlidePosition string `json:"slidePosition"`
}

type CurtainDeviceStatusResponse added in v0.3.2

type CurtainDeviceStatusResponse struct {
	CommonResponse
	Body *CurtainDeviceStatusBody `json:"body"`
}

type CurtainPositionMode added in v0.3.3

type CurtainPositionMode string
const (
	CurtainPositionModePerformance CurtainPositionMode = "0"
	CurtainPositionModeSilent      CurtainPositionMode = "1"
	CurtainPositionModeDefault     CurtainPositionMode = "ff"
)

type DeviceIDGettable added in v0.3.6

type DeviceIDGettable interface {
	GetDeviceID() string
}

type EvaporativeHumidifierDevice added in v0.3.2

type EvaporativeHumidifierDevice struct {
	CommonDeviceListItem
}

func (*EvaporativeHumidifierDevice) ExecCommand added in v0.4.0

func (device *EvaporativeHumidifierDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the EvaporativeHumidifierDevice

func (*EvaporativeHumidifierDevice) GetAnyStatusBody added in v0.3.5

func (device *EvaporativeHumidifierDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*EvaporativeHumidifierDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *EvaporativeHumidifierDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the EvaporativeHumidifierDevice command parameter

func (*EvaporativeHumidifierDevice) GetStatus added in v0.3.2

func (*EvaporativeHumidifierDevice) SetChildLock added in v0.3.2

func (device *EvaporativeHumidifierDevice) SetChildLock(flag bool) (*CommonResponse, error)

SetChildLock sends a command to set the child lock of the EvaporativeHumidifierDevice

func (*EvaporativeHumidifierDevice) SetMode added in v0.3.2

func (device *EvaporativeHumidifierDevice) SetMode(mode EvaporativeHumidifierMode, targetHumidity int) (*CommonResponse, error)

SetMode sends a command to set the mode of the EvaporativeHumidifierDevice

func (*EvaporativeHumidifierDevice) TurnOff added in v0.3.2

func (device *EvaporativeHumidifierDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the EvaporativeHumidifierDevice

func (*EvaporativeHumidifierDevice) TurnOn added in v0.3.2

func (device *EvaporativeHumidifierDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the EvaporativeHumidifierDevice

type EvaporativeHumidifierDeviceCommandParameter added in v0.4.0

type EvaporativeHumidifierDeviceCommandParameter struct {
	Command        string `` /* 205-byte string literal not displayed */
	Mode           int    `` /* 164-byte string literal not displayed */
	TargetHumidity int    `json:"targetHumidity" title:"TargetHumidity" minimum:"0" maximum:"100" description:"Target humidity level (0-100%)"`
	ChildLock      bool   `json:"childLock" title:"ChildLock" description:"true:lock, false:unlock"`
	// contains filtered or unexported fields
}

EvaporativeHumidifierDeviceCommandParameter is a struct that represents the command parameter for the EvaporativeHumidifierDevice

func (*EvaporativeHumidifierDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *EvaporativeHumidifierDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the EvaporativeHumidifierDevice command parameter

type EvaporativeHumidifierDeviceCommandSetChildLockIfExposer added in v0.4.0

type EvaporativeHumidifierDeviceCommandSetChildLockIfExposer struct{}

EvaporativeHumidifierDeviceCommandSetChildLockIfExposer represents the SetChildLock command parameters

func (*EvaporativeHumidifierDeviceCommandSetChildLockIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *EvaporativeHumidifierDeviceCommandSetChildLockIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the EvaporativeHumidifierDevice command parameter for SetChildLock

func (*EvaporativeHumidifierDeviceCommandSetChildLockIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *EvaporativeHumidifierDeviceCommandSetChildLockIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the EvaporativeHumidifierDevice command parameter for SetChildLock

type EvaporativeHumidifierDeviceCommandSetModeIfExposer added in v0.4.0

type EvaporativeHumidifierDeviceCommandSetModeIfExposer struct{}

EvaporativeHumidifierDeviceCommandSetModeIfExposer represents the SetMode command parameters

func (*EvaporativeHumidifierDeviceCommandSetModeIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *EvaporativeHumidifierDeviceCommandSetModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the EvaporativeHumidifierDevice command parameter for SetMode

func (*EvaporativeHumidifierDeviceCommandSetModeIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *EvaporativeHumidifierDeviceCommandSetModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the EvaporativeHumidifierDevice command parameter for SetMode

type EvaporativeHumidifierDeviceFilterElement added in v0.3.2

type EvaporativeHumidifierDeviceFilterElement struct {
	EffectiveUsageHours int `json:"effectiveUsageHours"`
	UsedHours           int `json:"usedHours"`
}

type EvaporativeHumidifierDeviceStatusBody added in v0.3.2

type EvaporativeHumidifierDeviceStatusBody struct {
	CommonDevice
	Power         string                                   `json:"power"`
	Humidity      int                                      `json:"humidity"`
	Mode          int                                      `json:"mode"`
	Drying        bool                                     `json:"drying"`
	ChildLock     bool                                     `json:"childLock"`
	FilterElement EvaporativeHumidifierDeviceFilterElement `json:"filterElement"`
	Version       int                                      `json:"version"`
}

type EvaporativeHumidifierDeviceStatusResponse added in v0.3.2

type EvaporativeHumidifierDeviceStatusResponse struct {
	CommonResponse
	Body *EvaporativeHumidifierDeviceStatusBody `json:"body"`
}

type EvaporativeHumidifierMode added in v0.3.2

type EvaporativeHumidifierMode int

type EvaporativeHumidifierModeParam added in v0.3.4

type EvaporativeHumidifierModeParam struct {
	Mode           EvaporativeHumidifierMode `json:"mode"`
	TargetHumidity int                       `json:"targetHumidity"`
}

EvaporativeHumidifierModeParam represents the parameters for setting the mode of the EvaporativeHumidifierDevice.

type ExecutableCommandDevice added in v0.4.0

type ExecutableCommandDevice interface {
	GetCommandParameterJSONSchema() (string, error)
	ExecCommand(jsonString string) (*CommonResponse, error)
}

type FloorCleaningAction added in v0.3.2

type FloorCleaningAction string

FloorCleaningAction represents the action to be performed floor cleaning mode.

const (
	FloorCleaningActionSweep    FloorCleaningAction = "sweep"
	FloorCleaningActionSweepMop FloorCleaningAction = "sweep_mop"
)

type FloorCleaningActionCombo added in v0.5.0

type FloorCleaningActionCombo string

FloorCleaningActionCombo represents the action to be performed in floor cleaning mode for Combo devices.

const (
	FloorCleaningActionSweepCombo FloorCleaningActionCombo = "sweep"
	FloorCleaningActionMopCombo   FloorCleaningActionCombo = "mop"
)

type FloorCleaningComboParam added in v0.5.0

type FloorCleaningComboParam struct {
	FanLevel int `json:"fanLevel"`
	Times    int `json:"times"`
}

FloorCleaningComboParam represents the parameters for floor cleaning mode for Combo devices.

func NewFloorCleaningComboParam added in v0.5.0

func NewFloorCleaningComboParam(fanLevel int, times int) (*FloorCleaningComboParam, error)

NewFloorCleaningComboParam creates a new FloorCleaningComboParam instance with validation.

type FloorCleaningParam added in v0.3.2

type FloorCleaningParam struct {
	FanLevel   int `json:"fanLevel"`
	WaterLevel int `json:"waterLevel"`
	Times      int `json:"times"`
}

FloorCleaningParam represents the parameters for floor cleaning mode.

func NewFloorCleaningParam added in v0.3.2

func NewFloorCleaningParam(fanLevel int, waterLevel int, times int) (*FloorCleaningParam, error)

NewFloorCleaningParam creates a new FloorCleaningParam instance with validation.

type GarageDoorOpenerDevice added in v0.5.0

type GarageDoorOpenerDevice struct {
	CommonDeviceListItem
}

GarageDoorOpenerDevice represents a SwitchBot Garage Door Opener device

func (*GarageDoorOpenerDevice) ExecCommand added in v0.5.0

func (device *GarageDoorOpenerDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the GarageDoorOpenerDevice

func (*GarageDoorOpenerDevice) GetAnyStatusBody added in v0.5.0

func (device *GarageDoorOpenerDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*GarageDoorOpenerDevice) GetCommandParameterJSONSchema added in v0.5.0

func (device *GarageDoorOpenerDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the GarageDoorOpenerDevice command parameter

func (*GarageDoorOpenerDevice) GetStatus added in v0.5.0

GetStatus retrieves the current status of the GarageDoorOpenerDevice

func (*GarageDoorOpenerDevice) TurnOff added in v0.5.0

func (device *GarageDoorOpenerDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the GarageDoorOpenerDevice

func (*GarageDoorOpenerDevice) TurnOn added in v0.5.0

func (device *GarageDoorOpenerDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the GarageDoorOpenerDevice

type GarageDoorOpenerDeviceCommandParameter added in v0.5.0

type GarageDoorOpenerDeviceCommandParameter struct {
	Command string `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

GarageDoorOpenerDeviceCommandParameter is a struct that represents the command parameter for the GarageDoorOpenerDevice

type GarageDoorOpenerDeviceStatusBody added in v0.5.0

type GarageDoorOpenerDeviceStatusBody struct {
	CommonDevice
	DoorStatus int    `json:"doorStatus"`
	Online     bool   `json:"online"`
	Version    string `json:"version"`
}

GarageDoorOpenerDeviceStatusBody represents the status of a Garage Door Opener device

type GarageDoorOpenerDeviceStatusResponse added in v0.5.0

type GarageDoorOpenerDeviceStatusResponse struct {
	CommonResponse
	Body *GarageDoorOpenerDeviceStatusBody `json:"body"`
}

GarageDoorOpenerDeviceStatusResponse represents the response from getting the status of a Garage Door Opener device

type GetDevicesResponse

type GetDevicesResponse struct {
	CommonResponse
	Body GetDevicesResponseBody `json:"body"`
}

type GetDevicesResponseBody

type GetDevicesResponseBody struct {
	DeviceList         []interface{} `json:"deviceList"`
	InfraredRemoteList []interface{} `json:"infraredRemoteList"`
}

type Hub2Device added in v0.2.0

type Hub2Device struct {
	CommonDeviceListItem
}

func (*Hub2Device) GetAnyStatusBody added in v0.3.5

func (device *Hub2Device) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*Hub2Device) GetStatus added in v0.2.0

func (device *Hub2Device) GetStatus() (*Hub2DeviceStatusResponse, error)

type Hub2DeviceStatusBody added in v0.2.0

type Hub2DeviceStatusBody struct {
	CommonDevice
	Temperature float64 `json:"temperature"`
	LightLevel  int     `json:"lightLevel"`
	Version     string  `json:"version"`
	Humidity    int     `json:"humidity"`
}

type Hub2DeviceStatusResponse added in v0.2.0

type Hub2DeviceStatusResponse struct {
	CommonResponse
	Body *Hub2DeviceStatusBody `json:"body"`
}

type Hub3Device added in v0.5.0

type Hub3Device struct {
	CommonDeviceListItem
}

func (*Hub3Device) GetAnyStatusBody added in v0.5.0

func (device *Hub3Device) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*Hub3Device) GetStatus added in v0.5.0

func (device *Hub3Device) GetStatus() (*Hub3DeviceStatusResponse, error)

type Hub3DeviceStatusBody added in v0.5.0

type Hub3DeviceStatusBody struct {
	CommonDevice
	Temperature  float64 `json:"temperature"`
	LightLevel   int     `json:"lightLevel"`
	Version      string  `json:"version"`
	Humidity     int     `json:"humidity"`
	MoveDetected bool    `json:"moveDetected"`
	Online       string  `json:"online"`
}

type Hub3DeviceStatusResponse added in v0.5.0

type Hub3DeviceStatusResponse struct {
	CommonResponse
	Body *Hub3DeviceStatusBody `json:"body"`
}

type HubDevice

type HubDevice struct {
	CommonDeviceListItem
}

type HumidifierDevice added in v0.3.2

type HumidifierDevice struct {
	CommonDeviceListItem
}

func (*HumidifierDevice) ExecCommand added in v0.4.0

func (device *HumidifierDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the HumidifierDevice

func (*HumidifierDevice) GetAnyStatusBody added in v0.3.5

func (device *HumidifierDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*HumidifierDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *HumidifierDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the HumidifierDevice command parameter

func (*HumidifierDevice) GetStatus added in v0.3.2

func (device *HumidifierDevice) GetStatus() (*HumidifierDeviceStatusResponse, error)

func (*HumidifierDevice) SetMode added in v0.3.2

func (device *HumidifierDevice) SetMode(mode HumidifierMode) (*CommonResponse, error)

SetMode sends a command to set the mode of the HumidifierDevice

func (*HumidifierDevice) SetTargetHumidity added in v0.3.2

func (device *HumidifierDevice) SetTargetHumidity(targetHumidity int) (*CommonResponse, error)

SetTargetHumidity sends a command to set the target humidity of the HumidifierDevice

func (*HumidifierDevice) TurnOff added in v0.3.2

func (device *HumidifierDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the HumidifierDevice

func (*HumidifierDevice) TurnOn added in v0.3.2

func (device *HumidifierDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the HumidifierDevice

type HumidifierDeviceCommandParameter added in v0.4.0

type HumidifierDeviceCommandParameter struct {
	Command        string `` /* 254-byte string literal not displayed */
	Mode           string `json:"mode" title:"Mode" enum:"Auto,Low,Medium,High" description:"Auto: auto mode, Low:34%, Medium:67%, High:100%"`
	TargetHumidity int    `json:"targetHumidity" title:"TargetHumidity" minimum:"0" maximum:"100" description:"Target humidity level (0-100%)"`
	// contains filtered or unexported fields
}

HumidifierDeviceCommandParameter is a struct that represents the command parameter for the HumidifierDevice

func (*HumidifierDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *HumidifierDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the HumidifierDevice command parameter

type HumidifierDeviceCommandSetModeIfExposer added in v0.4.0

type HumidifierDeviceCommandSetModeIfExposer struct{}

HumidifierDeviceCommandSetModeIfExposer represents the SetMode command parameters

func (*HumidifierDeviceCommandSetModeIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *HumidifierDeviceCommandSetModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the HumidifierDevice command parameter for SetMode

func (*HumidifierDeviceCommandSetModeIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *HumidifierDeviceCommandSetModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the HumidifierDevice command parameter for SetMode

type HumidifierDeviceCommandSetTargetHumidityIfExposer added in v0.4.0

type HumidifierDeviceCommandSetTargetHumidityIfExposer struct{}

HumidifierDeviceCommandSetTargetHumidityIfExposer represents the SetTargetHumidity command parameters

func (*HumidifierDeviceCommandSetTargetHumidityIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *HumidifierDeviceCommandSetTargetHumidityIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the HumidifierDevice command parameter for SetTargetHumidity

func (*HumidifierDeviceCommandSetTargetHumidityIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *HumidifierDeviceCommandSetTargetHumidityIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the HumidifierDevice command parameter for SetTargetHumidity

type HumidifierDeviceStatusBody added in v0.3.2

type HumidifierDeviceStatusBody struct {
	CommonDevice
	Power                  string `json:"power"`
	Humidity               int    `json:"humidity"`
	Temperature            int    `json:"temperature"`
	NebulizationEfficiency int    `json:"nebulizationEfficiency"`
	Auto                   bool   `json:"auto"`
	ChildLock              bool   `json:"childLock"`
	Sound                  bool   `json:"sound"`
	LackWater              bool   `json:"lackWater"`
}

type HumidifierDeviceStatusResponse added in v0.3.2

type HumidifierDeviceStatusResponse struct {
	CommonResponse
	Body *HumidifierDeviceStatusBody `json:"body"`
}

type HumidifierMode added in v0.3.2

type HumidifierMode int

type IndoorCamDevice added in v0.3.2

type IndoorCamDevice struct {
	CommonDeviceListItem
}

type InfraredRemoteAirConditionerDevice added in v0.3.0

type InfraredRemoteAirConditionerDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteAirConditionerDevice represents an infrared remote-controlled air conditioner device.

func (*InfraredRemoteAirConditionerDevice) ExecCommand added in v0.4.0

func (device *InfraredRemoteAirConditionerDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the InfraredRemoteAirConditionerDevice

func (*InfraredRemoteAirConditionerDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *InfraredRemoteAirConditionerDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the InfraredRemoteAirConditionerDevice command parameter

func (*InfraredRemoteAirConditionerDevice) SetAll added in v0.3.0

func (device *InfraredRemoteAirConditionerDevice) SetAll(
	temperatureCelsius int, mode AirConditionerMode, fan AirConditionerFanMode, powerState AirConditionerPowerState,
) (*CommonResponse, error)

SetAll sends a command to configure all parameters of the InfraredRemoteAirConditionerDevice

type InfraredRemoteAirConditionerDeviceCommandParameter added in v0.4.0

type InfraredRemoteAirConditionerDeviceCommandParameter struct {
	Command            string `` /* 218-byte string literal not displayed */
	TemperatureCelsius int    `` /* 131-byte string literal not displayed */
	Mode               int    `json:"mode" title:"Mode" minimum:"1" maximum:"5" description:"Mode (1:auto, 2:cool, 3:dry, 4:fan, 5:heat)"`
	Fan                int    `json:"fan" title:"Fan" minimum:"1" maximum:"4" description:"Fan mode (1:auto, 2:low, 3:medium, 4:high)"`
	PowerState         string `json:"powerState" title:"Power State" enum:"on,off" description:"Power state (on/off)"`
	// contains filtered or unexported fields
}

InfraredRemoteAirConditionerDeviceCommandParameter is a struct that represents the command parameter for the InfraredRemoteAirConditionerDevice

func (*InfraredRemoteAirConditionerDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *InfraredRemoteAirConditionerDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the InfraredRemoteAirConditionerDevice command parameter

type InfraredRemoteAirConditionerDeviceCommandSetAllIfExposer added in v0.4.0

type InfraredRemoteAirConditionerDeviceCommandSetAllIfExposer struct{}

InfraredRemoteAirConditionerDeviceCommandSetAllIfExposer represents the SetAll command parameters

func (*InfraredRemoteAirConditionerDeviceCommandSetAllIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *InfraredRemoteAirConditionerDeviceCommandSetAllIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the InfraredRemoteAirConditionerDevice command parameter for SetAll

func (*InfraredRemoteAirConditionerDeviceCommandSetAllIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *InfraredRemoteAirConditionerDeviceCommandSetAllIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the InfraredRemoteAirConditionerDevice command parameter for SetAll

type InfraredRemoteAirPurifierDevice added in v0.3.0

type InfraredRemoteAirPurifierDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteAirPurifierDevice represents an infrared remote-controlled air purifier device.

type InfraredRemoteCameraDevice added in v0.3.0

type InfraredRemoteCameraDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteCameraDevice represents an infrared remote-controlled camera device.

type InfraredRemoteDevice added in v0.3.0

type InfraredRemoteDevice struct {
	Client      *Client
	DeviceID    string `json:"deviceId"`
	DeviceName  string `json:"deviceName"`
	RemoteType  string `json:"remoteType"`
	HubDeviceId string `json:"hubDeviceId"`
}

func (*InfraredRemoteDevice) GetDeviceID added in v0.3.7

func (device *InfraredRemoteDevice) GetDeviceID() string

func (*InfraredRemoteDevice) TurnOff added in v0.3.0

func (device *InfraredRemoteDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the InfraredRemoteDevice

func (*InfraredRemoteDevice) TurnOn added in v0.3.0

func (device *InfraredRemoteDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the InfraredRemoteDevice

type InfraredRemoteDvdPlayerDevice added in v0.3.0

type InfraredRemoteDvdPlayerDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteDvdPlayerDevice represents an infrared remote-controlled DVD player device.

func (*InfraredRemoteDvdPlayerDevice) ExecCommand added in v0.4.0

func (device *InfraredRemoteDvdPlayerDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the InfraredRemoteDvdPlayerDevice

func (*InfraredRemoteDvdPlayerDevice) FastForward added in v0.3.0

func (device *InfraredRemoteDvdPlayerDevice) FastForward() (*CommonResponse, error)

FastForward sends a command to fast-forward the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

func (*InfraredRemoteDvdPlayerDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *InfraredRemoteDvdPlayerDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the InfraredRemoteDvdPlayerDevice command parameter

func (*InfraredRemoteDvdPlayerDevice) Next added in v0.3.0

Next sends a command to play the next track on the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

func (*InfraredRemoteDvdPlayerDevice) Pause added in v0.3.0

Pause sends a command to pause the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

func (*InfraredRemoteDvdPlayerDevice) Play added in v0.3.0

Play sends a command to play/resume the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

func (*InfraredRemoteDvdPlayerDevice) Previous added in v0.3.0

func (device *InfraredRemoteDvdPlayerDevice) Previous() (*CommonResponse, error)

Previous sends a command to play the previous track on the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

func (*InfraredRemoteDvdPlayerDevice) Rewind added in v0.3.0

func (device *InfraredRemoteDvdPlayerDevice) Rewind() (*CommonResponse, error)

Rewind sends a command to rewind the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

func (*InfraredRemoteDvdPlayerDevice) SetMute added in v0.3.0

func (device *InfraredRemoteDvdPlayerDevice) SetMute() (*CommonResponse, error)

SetMute sends a command to mute/unmute the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

func (*InfraredRemoteDvdPlayerDevice) Stop added in v0.3.0

Stop sends a command to stop the InfraredRemoteDvdPlayerDevice / InfraredRemoteSpeakerDevice

type InfraredRemoteDvdPlayerDeviceCommandParameter added in v0.4.0

type InfraredRemoteDvdPlayerDeviceCommandParameter struct {
	Command string `` /* 342-byte string literal not displayed */
	// contains filtered or unexported fields
}

InfraredRemoteDvdPlayerDeviceCommandParameter is a struct that represents the command parameter for the InfraredRemoteDvdPlayerDevice

type InfraredRemoteFanDevice added in v0.3.0

type InfraredRemoteFanDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteFanDevice represents an infrared remote-controlled fan device.

func (*InfraredRemoteFanDevice) ExecCommand added in v0.4.0

func (device *InfraredRemoteFanDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the InfraredRemoteFanDevice

func (*InfraredRemoteFanDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *InfraredRemoteFanDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the InfraredRemoteFanDevice command parameter

func (*InfraredRemoteFanDevice) HighSpeed added in v0.3.0

func (device *InfraredRemoteFanDevice) HighSpeed() (*CommonResponse, error)

HighSpeed sends a command to set the fan speed to high on the InfraredRemoteFanDevice

func (*InfraredRemoteFanDevice) LowSpeed added in v0.3.0

func (device *InfraredRemoteFanDevice) LowSpeed() (*CommonResponse, error)

LowSpeed sends a command to set the fan speed to low on the InfraredRemoteFanDevice

func (*InfraredRemoteFanDevice) MiddleSpeed added in v0.3.0

func (device *InfraredRemoteFanDevice) MiddleSpeed() (*CommonResponse, error)

MiddleSpeed sends a command to set the fan speed to middle on the InfraredRemoteFanDevice

func (*InfraredRemoteFanDevice) Swing added in v0.3.0

func (device *InfraredRemoteFanDevice) Swing() (*CommonResponse, error)

Swing sends a command to enable/disable the swing feature of the InfraredRemoteFanDevice

func (*InfraredRemoteFanDevice) Timer added in v0.3.0

func (device *InfraredRemoteFanDevice) Timer() (*CommonResponse, error)

Timer sends a command to set the timer of the InfraredRemoteFanDevice

type InfraredRemoteFanDeviceCommandParameter added in v0.4.0

type InfraredRemoteFanDeviceCommandParameter struct {
	Command string `` /* 328-byte string literal not displayed */
	// contains filtered or unexported fields
}

InfraredRemoteFanDeviceCommandParameter is a struct that represents the command parameter for the InfraredRemoteFanDevice

type InfraredRemoteLightDevice added in v0.3.0

type InfraredRemoteLightDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteLightDevice represents an infrared remote-controlled light device.

func (*InfraredRemoteLightDevice) BrightnessDown added in v0.3.0

func (device *InfraredRemoteLightDevice) BrightnessDown() (*CommonResponse, error)

BrightnessDown sends a command to decrease the brightness of the InfraredRemoteLightDevice

func (*InfraredRemoteLightDevice) BrightnessUp added in v0.3.0

func (device *InfraredRemoteLightDevice) BrightnessUp() (*CommonResponse, error)

BrightnessUp sends a command to increase the brightness of the InfraredRemoteLightDevice

func (*InfraredRemoteLightDevice) ExecCommand added in v0.4.0

func (device *InfraredRemoteLightDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the InfraredRemoteLightDevice

func (*InfraredRemoteLightDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *InfraredRemoteLightDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the InfraredRemoteLightDevice command parameter

type InfraredRemoteLightDeviceCommandParameter added in v0.4.0

type InfraredRemoteLightDeviceCommandParameter struct {
	Command string `` /* 233-byte string literal not displayed */
	// contains filtered or unexported fields
}

InfraredRemoteLightDeviceCommandParameter is a struct that represents the command parameter for the InfraredRemoteLightDevice

type InfraredRemoteOthersDevice added in v0.3.0

type InfraredRemoteOthersDevice struct {
	Client      *Client
	DeviceID    string `json:"deviceId"`
	DeviceName  string `json:"deviceName"`
	RemoteType  string `json:"remoteType"`
	HubDeviceId string `json:"hubDeviceId"`
}

InfraredRemoteOthersDevice represents an infrared remote-controlled device of other types.

func (*InfraredRemoteOthersDevice) CustomCommand added in v0.3.0

func (device *InfraredRemoteOthersDevice) CustomCommand(buttonName string) (*CommonResponse, error)

CustomCommand sends a user-defined command to the InfraredRemoteOthersDevice

func (*InfraredRemoteOthersDevice) GetDeviceID added in v0.3.7

func (device *InfraredRemoteOthersDevice) GetDeviceID() string

type InfraredRemoteProjectorDevice added in v0.3.0

type InfraredRemoteProjectorDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteProjectorDevice represents an infrared remote-controlled projector device.

type InfraredRemoteRobotVacuumCleanerDevice added in v0.3.0

type InfraredRemoteRobotVacuumCleanerDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteRobotVacuumCleanerDevice represents an infrared remote-controlled robot vacuum cleaner device.

type InfraredRemoteSetTopBoxDevice added in v0.3.0

type InfraredRemoteSetTopBoxDevice struct {
	InfraredRemoteTVDevice
}

InfraredRemoteSetTopBoxDevice represents an infrared remote-controlled set-top box device.

type InfraredRemoteSpeakerDevice added in v0.3.0

type InfraredRemoteSpeakerDevice struct {
	InfraredRemoteDvdPlayerDevice
}

InfraredRemoteSpeakerDevice represents an infrared remote-controlled speaker device.

func (*InfraredRemoteSpeakerDevice) ExecCommand added in v0.4.0

func (device *InfraredRemoteSpeakerDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the InfraredRemoteSpeakerDevice

func (*InfraredRemoteSpeakerDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *InfraredRemoteSpeakerDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the InfraredRemoteSpeakerDevice command parameter

func (*InfraredRemoteSpeakerDevice) VolumeAdd added in v0.3.0

func (device *InfraredRemoteSpeakerDevice) VolumeAdd() (*CommonResponse, error)

VolumeAdd sends a command to increase the volume of the InfraredRemoteSpeakerDevice

func (*InfraredRemoteSpeakerDevice) VolumeSub added in v0.3.0

func (device *InfraredRemoteSpeakerDevice) VolumeSub() (*CommonResponse, error)

VolumeSub sends a command to decrease the volume of the InfraredRemoteSpeakerDevice

type InfraredRemoteSpeakerDeviceCommandParameter added in v0.4.0

type InfraredRemoteSpeakerDeviceCommandParameter struct {
	Command string `` /* 410-byte string literal not displayed */
	// contains filtered or unexported fields
}

InfraredRemoteSpeakerDeviceCommandParameter is a struct that represents the command parameter for the InfraredRemoteSpeakerDevice

type InfraredRemoteStreamerDevice added in v0.3.0

type InfraredRemoteStreamerDevice struct {
	InfraredRemoteTVDevice
}

InfraredRemoteStreamerDevice represents an infrared remote-controlled streamer device.

type InfraredRemoteTVDevice added in v0.3.0

type InfraredRemoteTVDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteTVDevice represents an infrared remote-controlled TV device.

func (*InfraredRemoteTVDevice) ChannelAdd added in v0.3.0

func (device *InfraredRemoteTVDevice) ChannelAdd() (*CommonResponse, error)

ChannelAdd sends a command to increase the channel of the InfraredRemoteTVDevice / InfraredRemoteStreamerDevice / InfraredRemoteSetTopBoxDevice

func (*InfraredRemoteTVDevice) ChannelSub added in v0.4.0

func (device *InfraredRemoteTVDevice) ChannelSub() (*CommonResponse, error)

ChannelSub sends a command to decrease the channel of the InfraredRemoteTVDevice / InfraredRemoteStreamerDevice / InfraredRemoteSetTopBoxDevice

func (*InfraredRemoteTVDevice) ExecCommand added in v0.4.0

func (device *InfraredRemoteTVDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the InfraredRemoteTVDevice

func (*InfraredRemoteTVDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *InfraredRemoteTVDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the InfraredRemoteTVDevice command parameter

func (*InfraredRemoteTVDevice) SetChannel added in v0.3.0

func (device *InfraredRemoteTVDevice) SetChannel(channel int) (*CommonResponse, error)

SetChannel sends a command to set the channel of the InfraredRemoteTVDevice / InfraredRemoteStreamerDevice / InfraredRemoteSetTopBoxDevice

func (*InfraredRemoteTVDevice) VolumeAdd added in v0.3.0

func (device *InfraredRemoteTVDevice) VolumeAdd() (*CommonResponse, error)

VolumeAdd sends a command to increase the volume of the InfraredRemoteTVDevice / InfraredRemoteStreamerDevice / InfraredRemoteSetTopBoxDevice

func (*InfraredRemoteTVDevice) VolumeSub added in v0.3.0

func (device *InfraredRemoteTVDevice) VolumeSub() (*CommonResponse, error)

VolumeSub sends a command to decrease the volume of the InfraredRemoteTVDevice / InfraredRemoteStreamerDevice / InfraredRemoteSetTopBoxDevice

type InfraredRemoteTVDeviceCommandParameter added in v0.4.0

type InfraredRemoteTVDeviceCommandParameter struct {
	Command string `` /* 328-byte string literal not displayed */
	Channel int    `json:"channel" title:"Channel" minimum:"1" description:"Channel number for SetChannel command"`
	// contains filtered or unexported fields
}

InfraredRemoteTVDeviceCommandParameter is a struct that represents the command parameter for the InfraredRemoteTVDevice

func (*InfraredRemoteTVDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *InfraredRemoteTVDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the InfraredRemoteTVDevice command parameter

type InfraredRemoteTVDeviceCommandSetChannelIfExposer added in v0.4.0

type InfraredRemoteTVDeviceCommandSetChannelIfExposer struct{}

InfraredRemoteTVDeviceCommandSetChannelIfExposer represents the SetChannel command parameters

func (*InfraredRemoteTVDeviceCommandSetChannelIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *InfraredRemoteTVDeviceCommandSetChannelIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the InfraredRemoteTVDevice command parameter for SetChannel

func (*InfraredRemoteTVDeviceCommandSetChannelIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *InfraredRemoteTVDeviceCommandSetChannelIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the InfraredRemoteTVDevice command parameter for SetChannel

type InfraredRemoteWaterHeaterDevice added in v0.3.0

type InfraredRemoteWaterHeaterDevice struct {
	InfraredRemoteDevice
}

InfraredRemoteWaterHeaterDevice represents an infrared remote-controlled water heater device.

type KeyListItem added in v0.3.2

type KeyListItem struct {
	Id         int    `json:"id"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Password   string `json:"password"`
	Iv         string `json:"iv"`
	Status     string `json:"status"`
	CreateTime int64  `json:"createTime"`
}

type KeypadDevice added in v0.3.2

type KeypadDevice struct {
	CommonDeviceListItem
	LockDevicesIds []string      `json:"lockDevicesIds"`
	KeyList        []KeyListItem `json:"keyList"`
}

func (*KeypadDevice) CreateKey added in v0.3.2

func (device *KeypadDevice) CreateKey(keypadKey *KeypadKey) (*CommonResponse, error)

CreateKey sends a command to create a new key for the KeypadDevice. Note: The result of this request is not returned by this method but is asynchronously returned via a webhook.

func (*KeypadDevice) DeleteKey added in v0.3.2

func (device *KeypadDevice) DeleteKey(id string) (*CommonResponse, error)

DeleteKey sends a command to delete a key from the KeypadDevice. Note: The result of this request is not returned by this method but is asynchronously returned via a webhook.

func (*KeypadDevice) ExecCommand added in v0.4.0

func (device *KeypadDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the KeypadDevice

func (*KeypadDevice) GetAnyStatusBody added in v0.3.5

func (device *KeypadDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*KeypadDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *KeypadDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the KeypadDevice command parameter

func (*KeypadDevice) GetStatus added in v0.3.2

func (device *KeypadDevice) GetStatus() (*KeypadStatusResponse, error)

type KeypadDeviceCommandCreateNormalKeyIfExposer added in v0.4.0

type KeypadDeviceCommandCreateNormalKeyIfExposer struct{}

KeypadDeviceCommandCreateNormalKeyIfExposer represents the CreateKey command parameters for types: permanent and urgent.

func (*KeypadDeviceCommandCreateNormalKeyIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *KeypadDeviceCommandCreateNormalKeyIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the KeypadDeviceCommandCreateNormalKeyIfExposer parameter

func (*KeypadDeviceCommandCreateNormalKeyIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *KeypadDeviceCommandCreateNormalKeyIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the KeypadDeviceCommandCreateNormalKeyIfExposer parameter

type KeypadDeviceCommandCreateTimeLimitKeyIfExposer added in v0.4.0

type KeypadDeviceCommandCreateTimeLimitKeyIfExposer struct{}

KeypadDeviceCommandCreateTimeLimitKeyIfExposer represents the CreateKey command parameters for type: timeLimit and disposable

func (*KeypadDeviceCommandCreateTimeLimitKeyIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *KeypadDeviceCommandCreateTimeLimitKeyIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the KeypadDeviceCommandCreateTimeLimitKeyIfExposer parameter

func (*KeypadDeviceCommandCreateTimeLimitKeyIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *KeypadDeviceCommandCreateTimeLimitKeyIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the KeypadDeviceCommandCreateTimeLimitKeyIfExposer parameter

type KeypadDeviceCommandDeleteKeyIfExposer added in v0.4.0

type KeypadDeviceCommandDeleteKeyIfExposer struct{}

KeypadDeviceCommandDeleteKeyIfExposer represents the DeleteKey command parameters

func (*KeypadDeviceCommandDeleteKeyIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *KeypadDeviceCommandDeleteKeyIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the KeypadDeviceCommandCreateNormalKeyIfExposer parameter

func (*KeypadDeviceCommandDeleteKeyIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *KeypadDeviceCommandDeleteKeyIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the KeypadDeviceCommandCreateNormalKeyIfExposer parameter

type KeypadDeviceCommandParameter added in v0.4.0

type KeypadDeviceCommandParameter struct {
	Command   string `` /* 158-byte string literal not displayed */
	Id        string `json:"id" title:"ID" description:"the id of the passcode"`
	Name      string `json:"name" title:"Name" description:"a unique name for the passcode"`
	Type      string `` /* 235-byte string literal not displayed */
	Password  string `json:"password" title:"Password" pattern:"^[0-9]{6,12}$" description:"a 6 to 12-digit passcode in plain text"`
	StartTime int64  `` /* 229-byte string literal not displayed */
	EndTime   int64  `` /* 222-byte string literal not displayed */
	// contains filtered or unexported fields
}

KeypadDeviceCommandParameter is a struct that represents the command parameter for the KeypadDevice

func (*KeypadDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *KeypadDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the KeypadDevice command parameter

type KeypadDeviceStatusBody added in v0.3.2

type KeypadDeviceStatusBody struct {
	CommonDevice
}

type KeypadKey added in v0.3.2

type KeypadKey struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	Password  string `json:"password"`
	StartTime int64  `json:"startTime,omitempty"`
	EndTime   int64  `json:"endTime,omitempty"`
}

func NewKeypadKey added in v0.3.2

func NewKeypadKey(name string, keyType string, password string, startTime int64, endTime int64) (*KeypadKey, error)

NewKeypadKey creates a new KeypadKey instance with validation.

type KeypadStatusResponse added in v0.3.2

type KeypadStatusResponse struct {
	CommonResponse
	Body *KeypadDeviceStatusBody `json:"body"`
}

type LockDevice added in v0.2.0

type LockDevice struct {
	CommonDeviceListItem
	Group          bool     `json:"group"`
	Master         bool     `json:"master"`
	GroupName      string   `json:"groupName"`
	LockDevicesIds []string `json:"lockDevicesIds"`
}

func (*LockDevice) ExecCommand added in v0.4.0

func (device *LockDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the LockDevice

func (*LockDevice) GetAnyStatusBody added in v0.3.5

func (device *LockDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*LockDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *LockDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the LockDevice command parameter

func (*LockDevice) GetStatus added in v0.2.0

func (device *LockDevice) GetStatus() (*LockDeviceStatusResponse, error)

func (*LockDevice) Lock added in v0.2.0

func (device *LockDevice) Lock() (*CommonResponse, error)

Lock sends a command to lock the LockDevice

func (*LockDevice) Unlock added in v0.2.0

func (device *LockDevice) Unlock() (*CommonResponse, error)

Unlock sends a command to unlock the LockDevice

type LockDeviceCommandParameter added in v0.4.0

type LockDeviceCommandParameter struct {
	Command string `` /* 146-byte string literal not displayed */
	// contains filtered or unexported fields
}

LockDeviceCommandParameter is a struct that represents the command parameter for the LockDevice

type LockDeviceStatusBody added in v0.2.0

type LockDeviceStatusBody struct {
	CommonDevice
	Battery   int    `json:"battery"`
	Version   string `json:"version"`
	LockState string `json:"lockState"`
	DoorState string `json:"doorState"`
	Calibrate bool   `json:"calibrate"`
}

type LockDeviceStatusResponse added in v0.2.0

type LockDeviceStatusResponse struct {
	CommonResponse
	Body *LockDeviceStatusBody `json:"body"`
}

type LockLiteDevice added in v0.5.0

type LockLiteDevice struct {
	CommonDeviceListItem
	Group          bool     `json:"group"`
	Master         bool     `json:"master"`
	GroupName      string   `json:"groupName"`
	LockDevicesIds []string `json:"lockDevicesIds"`
}

func (*LockLiteDevice) ExecCommand added in v0.5.0

func (device *LockLiteDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the LockLiteDevice

func (*LockLiteDevice) GetAnyStatusBody added in v0.5.0

func (device *LockLiteDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*LockLiteDevice) GetCommandParameterJSONSchema added in v0.5.0

func (device *LockLiteDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the LockLiteDevice command parameter

func (*LockLiteDevice) GetStatus added in v0.5.0

func (device *LockLiteDevice) GetStatus() (*LockLiteDeviceStatusResponse, error)

func (*LockLiteDevice) Lock added in v0.5.0

func (device *LockLiteDevice) Lock() (*CommonResponse, error)

Lock sends a command to lock the LockLiteDevice

func (*LockLiteDevice) Unlock added in v0.5.0

func (device *LockLiteDevice) Unlock() (*CommonResponse, error)

Unlock sends a command to unlock the LockLiteDevice

type LockLiteDeviceCommandParameter added in v0.5.0

type LockLiteDeviceCommandParameter struct {
	Command string `` /* 146-byte string literal not displayed */
	// contains filtered or unexported fields
}

LockLiteDeviceCommandParameter is a struct that represents the command parameter for the LockLiteDevice

type LockLiteDeviceStatusBody added in v0.5.0

type LockLiteDeviceStatusBody struct {
	CommonDevice
	Battery   int    `json:"battery"`
	Version   string `json:"version"`
	LockState string `json:"lockState"`
	Calibrate bool   `json:"calibrate"`
}

type LockLiteDeviceStatusResponse added in v0.5.0

type LockLiteDeviceStatusResponse struct {
	CommonResponse
	Body *LockLiteDeviceStatusBody `json:"body"`
}

type MeterDevice

type MeterDevice struct {
	CommonDeviceListItem
}

func (*MeterDevice) GetAnyStatusBody added in v0.3.5

func (device *MeterDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*MeterDevice) GetStatus added in v0.2.0

func (device *MeterDevice) GetStatus() (*MeterDeviceStatusResponse, error)

type MeterDeviceStatusBody added in v0.2.0

type MeterDeviceStatusBody struct {
	CommonDevice
	Temperature float64 `json:"temperature"`
	Version     string  `json:"version"`
	Battery     int     `json:"battery"`
	Humidity    int     `json:"humidity"`
}

type MeterDeviceStatusResponse added in v0.2.0

type MeterDeviceStatusResponse struct {
	CommonResponse
	Body *MeterDeviceStatusBody `json:"body"`
}

type MeterProCo2Device

type MeterProCo2Device struct {
	CommonDeviceListItem
}

func (*MeterProCo2Device) GetAnyStatusBody added in v0.3.5

func (device *MeterProCo2Device) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*MeterProCo2Device) GetStatus added in v0.2.0

type MeterProCo2DeviceStatusBody added in v0.2.0

type MeterProCo2DeviceStatusBody struct {
	CommonDevice
	Temperature float64 `json:"temperature"`
	Version     string  `json:"version"`
	Battery     int     `json:"battery"`
	Humidity    int     `json:"humidity"`
	CO2         int     `json:"CO2"`
}

type MeterProCo2DeviceStatusResponse added in v0.2.0

type MeterProCo2DeviceStatusResponse struct {
	CommonResponse
	Body *MeterProCo2DeviceStatusBody `json:"body"`
}

type MotionSensorDevice

type MotionSensorDevice struct {
	CommonDeviceListItem
}

func (*MotionSensorDevice) GetAnyStatusBody added in v0.3.5

func (device *MotionSensorDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*MotionSensorDevice) GetStatus added in v0.2.0

type MotionSensorDeviceStatusBody added in v0.2.0

type MotionSensorDeviceStatusBody struct {
	CommonDevice
	Battery      int    `json:"battery"`
	Version      string `json:"version"`
	MoveDetected bool   `json:"moveDetected"`
	OpenState    string `json:"openState"`
	Brightness   string `json:"brightness"`
}

type MotionSensorDeviceStatusResponse added in v0.2.0

type MotionSensorDeviceStatusResponse struct {
	CommonResponse
	Body *MotionSensorDeviceStatusBody `json:"body"`
}

type Option

type Option func(*Client)

type PanTiltCamDevice added in v0.3.2

type PanTiltCamDevice struct {
	CommonDeviceListItem
}

type PlugDevice added in v0.3.2

type PlugDevice struct {
	CommonDeviceListItem
}

func (*PlugDevice) ExecCommand added in v0.4.0

func (device *PlugDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the PlugDevice

func (*PlugDevice) GetAnyStatusBody added in v0.3.5

func (device *PlugDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*PlugDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *PlugDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the PlugDevice command parameter

func (*PlugDevice) GetStatus added in v0.3.2

func (device *PlugDevice) GetStatus() (*PlugDeviceStatusResponse, error)

func (*PlugDevice) TurnOff added in v0.3.2

func (device *PlugDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the PlugDevice

func (*PlugDevice) TurnOn added in v0.3.2

func (device *PlugDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the PlugDevice

type PlugDeviceCommandParameter added in v0.4.0

type PlugDeviceCommandParameter struct {
	Command string `` /* 133-byte string literal not displayed */
	// contains filtered or unexported fields
}

PlugDeviceCommandParameter is a struct that represents the command parameter for the PlugDevice

type PlugDeviceStatusBody added in v0.3.2

type PlugDeviceStatusBody struct {
	CommonDevice
	Power   string `json:"power"`
	Version string `json:"version"`
}

type PlugDeviceStatusResponse added in v0.3.2

type PlugDeviceStatusResponse struct {
	CommonResponse
	Body *PlugDeviceStatusBody `json:"body"`
}

type PlugMiniDevice added in v0.3.2

type PlugMiniDevice struct {
	CommonDeviceListItem
}

func (*PlugMiniDevice) ExecCommand added in v0.4.0

func (device *PlugMiniDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the PlugMiniDevice

func (*PlugMiniDevice) GetAnyStatusBody added in v0.3.5

func (device *PlugMiniDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*PlugMiniDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *PlugMiniDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the PlugMiniDevice command parameter

func (*PlugMiniDevice) GetStatus added in v0.3.2

func (device *PlugMiniDevice) GetStatus() (*PlugMiniDeviceStatusResponse, error)

func (*PlugMiniDevice) Toggle added in v0.3.2

func (device *PlugMiniDevice) Toggle() (*CommonResponse, error)

Toggle sends a command to toggle the PlugMiniDevice

func (*PlugMiniDevice) TurnOff added in v0.3.2

func (device *PlugMiniDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the PlugMiniDevice

func (*PlugMiniDevice) TurnOn added in v0.3.2

func (device *PlugMiniDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the PlugMiniDevice

type PlugMiniDeviceCommandParameter added in v0.4.0

type PlugMiniDeviceCommandParameter struct {
	Command string `` /* 170-byte string literal not displayed */
	// contains filtered or unexported fields
}

PlugMiniDeviceCommandParameter is a struct that represents the command parameter for the PlugMiniDevice

type PlugMiniDeviceStatusBody added in v0.3.2

type PlugMiniDeviceStatusBody struct {
	CommonDevice
	Voltage          float64 `json:"voltage"`
	Version          string  `json:"version"`
	Weight           float64 `json:"weight"`
	ElectricityOfDay int     `json:"electricityOfDay"`
	ElectricCurrent  float64 `json:"electricCurrent"`
}

type PlugMiniDeviceStatusResponse added in v0.3.2

type PlugMiniDeviceStatusResponse struct {
	CommonResponse
	Body *PlugMiniDeviceStatusBody `json:"body"`
}

type RelaySwitch1Device added in v0.3.2

type RelaySwitch1Device struct {
	CommonDeviceListItem
}

func (*RelaySwitch1Device) ExecCommand added in v0.4.0

func (device *RelaySwitch1Device) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the RelaySwitch1Device

func (*RelaySwitch1Device) GetAnyStatusBody added in v0.3.5

func (device *RelaySwitch1Device) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*RelaySwitch1Device) GetCommandParameterJSONSchema added in v0.4.0

func (device *RelaySwitch1Device) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the RelaySwitch1Device command parameter

func (*RelaySwitch1Device) GetStatus added in v0.3.2

func (*RelaySwitch1Device) SetMode added in v0.3.2

func (device *RelaySwitch1Device) SetMode(mode RelaySwitchMode) (*CommonResponse, error)

SetMode sends a command to set the mode of the RelaySwitch1Device

func (*RelaySwitch1Device) Toggle added in v0.3.2

func (device *RelaySwitch1Device) Toggle() (*CommonResponse, error)

Toggle sends a command to toggle the RelaySwitch1Device

func (*RelaySwitch1Device) TurnOff added in v0.3.2

func (device *RelaySwitch1Device) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the RelaySwitch1Device

func (*RelaySwitch1Device) TurnOn added in v0.3.2

func (device *RelaySwitch1Device) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the RelaySwitch1Device

type RelaySwitch1DeviceCommandParameter added in v0.4.0

type RelaySwitch1DeviceCommandParameter struct {
	Command string `` /* 244-byte string literal not displayed */
	Mode    int    `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

RelaySwitch1DeviceCommandParameter is a struct that represents the command parameter for the RelaySwitch1Device

func (*RelaySwitch1DeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *RelaySwitch1DeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the RelaySwitch1Device command parameter

type RelaySwitch1DeviceCommandSetModeIfExposer added in v0.4.0

type RelaySwitch1DeviceCommandSetModeIfExposer struct{}

RelaySwitch1DeviceCommandSetModeIfExposer represents the SetMode command parameters

func (*RelaySwitch1DeviceCommandSetModeIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *RelaySwitch1DeviceCommandSetModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RelaySwitch1Device command parameter for SetMode

func (*RelaySwitch1DeviceCommandSetModeIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *RelaySwitch1DeviceCommandSetModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RelaySwitch1Device command parameter for SetMode

type RelaySwitch1DeviceStatusBody added in v0.3.2

type RelaySwitch1DeviceStatusBody struct {
	CommonDevice
	SwitchStatus int    `json:"switchStatus"`
	Version      string `json:"version"`
}

type RelaySwitch1DeviceStatusResponse added in v0.3.2

type RelaySwitch1DeviceStatusResponse struct {
	CommonResponse
	Body *RelaySwitch1DeviceStatusBody `json:"body"`
}

type RelaySwitch1PMDevice added in v0.3.2

type RelaySwitch1PMDevice struct {
	CommonDeviceListItem
}

func (*RelaySwitch1PMDevice) ExecCommand added in v0.4.0

func (device *RelaySwitch1PMDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the RelaySwitch1PMDevice

func (*RelaySwitch1PMDevice) GetAnyStatusBody added in v0.3.5

func (device *RelaySwitch1PMDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*RelaySwitch1PMDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *RelaySwitch1PMDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the RelaySwitch1PMDevice command parameter

func (*RelaySwitch1PMDevice) GetStatus added in v0.3.2

func (*RelaySwitch1PMDevice) SetMode added in v0.3.2

func (device *RelaySwitch1PMDevice) SetMode(mode RelaySwitchMode) (*CommonResponse, error)

SetMode sends a command to set the mode of the RelaySwitch1PMDevice

func (*RelaySwitch1PMDevice) Toggle added in v0.3.2

func (device *RelaySwitch1PMDevice) Toggle() (*CommonResponse, error)

Toggle sends a command to toggle the RelaySwitch1PMDevice

func (*RelaySwitch1PMDevice) TurnOff added in v0.3.2

func (device *RelaySwitch1PMDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the RelaySwitch1PMDevice

func (*RelaySwitch1PMDevice) TurnOn added in v0.3.2

func (device *RelaySwitch1PMDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the RelaySwitch1PMDevice

type RelaySwitch1PMDeviceStatusBody added in v0.3.2

type RelaySwitch1PMDeviceStatusBody struct {
	CommonDevice
	SwitchStatus    int    `json:"switchStatus"`
	Voltage         int    `json:"voltage"`
	Version         string `json:"version"`
	Power           int    `json:"power"`
	UsedElectricity int    `json:"usedElectricity"`
	ElectricCurrent int    `json:"electricCurrent"`
}

type RelaySwitch1PMDeviceStatusResponse added in v0.3.2

type RelaySwitch1PMDeviceStatusResponse struct {
	CommonResponse
	Body *RelaySwitch1PMDeviceStatusBody `json:"body"`
}

type RelaySwitch2PMDevice added in v0.5.0

type RelaySwitch2PMDevice struct {
	CommonDeviceListItem
}

RelaySwitch2PMDevice represents a SwitchBot Relay Switch 2PM device

func (*RelaySwitch2PMDevice) ExecCommand added in v0.5.0

func (device *RelaySwitch2PMDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the RelaySwitch2PMDevice

func (*RelaySwitch2PMDevice) GetAnyStatusBody added in v0.5.0

func (device *RelaySwitch2PMDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*RelaySwitch2PMDevice) GetCommandParameterJSONSchema added in v0.5.0

func (device *RelaySwitch2PMDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the RelaySwitch2PMDevice command parameter

func (*RelaySwitch2PMDevice) GetStatus added in v0.5.0

GetStatus retrieves the current status of the RelaySwitch2PMDevice

func (*RelaySwitch2PMDevice) SetMode added in v0.5.0

func (device *RelaySwitch2PMDevice) SetMode(switchNum int, mode RelaySwitchMode) (*CommonResponse, error)

SetMode sends a command to set the mode of the RelaySwitch2PMDevice

func (*RelaySwitch2PMDevice) Toggle added in v0.5.0

func (device *RelaySwitch2PMDevice) Toggle(switchNum int) (*CommonResponse, error)

Toggle sends a command to toggle the specified switch of the RelaySwitch2PMDevice switchNum: 1 for switch 1, 2 for switch 2

func (*RelaySwitch2PMDevice) TurnOff added in v0.5.0

func (device *RelaySwitch2PMDevice) TurnOff(switchNum int) (*CommonResponse, error)

TurnOff sends a command to turn off the specified switch of the RelaySwitch2PMDevice switchNum: 1 for switch 1, 2 for switch 2

func (*RelaySwitch2PMDevice) TurnOn added in v0.5.0

func (device *RelaySwitch2PMDevice) TurnOn(switchNum int) (*CommonResponse, error)

TurnOn sends a command to turn on the specified switch of the RelaySwitch2PMDevice switchNum: 1 for switch 1, 2 for switch 2

type RelaySwitch2PMDeviceCommandParameter added in v0.5.0

type RelaySwitch2PMDeviceCommandParameter struct {
	Command string `` /* 244-byte string literal not displayed */
	Switch  int    `json:"switch" title:"Switch" minimum:"1" maximum:"2" description:"Switch number (1 or 2)" required:"true"`
	Mode    int    `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

RelaySwitch2PMDeviceCommandParameter is a struct that represents the command parameter for the RelaySwitch2PMDevice

func (*RelaySwitch2PMDeviceCommandParameter) JSONSchemaAllOf added in v0.5.0

func (parameter *RelaySwitch2PMDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the RelaySwitch2PMDevice command parameter

type RelaySwitch2PMDeviceCommandSetModeIfExposer added in v0.5.0

type RelaySwitch2PMDeviceCommandSetModeIfExposer struct{}

RelaySwitch2PMDeviceCommandSetModeIfExposer represents the SetMode command parameters

func (*RelaySwitch2PMDeviceCommandSetModeIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RelaySwitch2PMDeviceCommandSetModeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RelaySwitch2PMDevice command parameter for SetMode

func (*RelaySwitch2PMDeviceCommandSetModeIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RelaySwitch2PMDeviceCommandSetModeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RelaySwitch2PMDevice command parameter for SetMode

type RelaySwitch2PMDeviceStatusBody added in v0.5.0

type RelaySwitch2PMDeviceStatusBody struct {
	CommonDevice
	Online                 bool   `json:"online"`
	Switch1Status          int    `json:"switch1Status"`
	Switch2Status          int    `json:"switch2Status"`
	Switch1Voltage         int    `json:"switch1voltage"`
	Switch2Voltage         int    `json:"switch2voltage"`
	Version                string `json:"version"`
	Switch1Power           int    `json:"switch1power"`
	Switch2Power           int    `json:"switch2power"`
	Switch1UsedElectricity int    `json:"switch1usedElectricity"`
	Switch2UsedElectricity int    `json:"switch2usedElectricity"`
	Switch1ElectricCurrent int    `json:"switch1electricCurrent"`
	Switch2ElectricCurrent int    `json:"switch2electricCurrent"`
	Calibrate              bool   `json:"calibrate"`
	Position               int    `json:"position"`
	IsStuck                string `json:"isStuck"`
}

RelaySwitch2PMDeviceStatusBody represents the status of a Relay Switch 2PM device

type RelaySwitch2PMDeviceStatusResponse added in v0.5.0

type RelaySwitch2PMDeviceStatusResponse struct {
	CommonResponse
	Body *RelaySwitch2PMDeviceStatusBody `json:"body"`
}

RelaySwitch2PMDeviceStatusResponse represents the response from getting the status of a Relay Switch 2PM device

type RelaySwitchMode added in v0.3.2

type RelaySwitchMode int

type RemoteDevice

type RemoteDevice struct {
	CommonDeviceListItem
}

type ResponseParser

type ResponseParser func(client *Client, bodyBytes []byte) error

func GetDeviceStatusResponseParser

func GetDeviceStatusResponseParser(response interface{}) ResponseParser

func GetDevicesResponseParser

func GetDevicesResponseParser(response *GetDevicesResponse) ResponseParser

type RobotVacuumCleanerComboDevice added in v0.5.0

type RobotVacuumCleanerComboDevice struct {
	CommonDeviceListItem
}

func (*RobotVacuumCleanerComboDevice) ChangeParam added in v0.5.0

func (device *RobotVacuumCleanerComboDevice) ChangeParam(floorCleaningParam *FloorCleaningParam) (*CommonResponse, error)

ChangeParam sends a command to change the cleaning parameters of the RobotVacuumCleanerComboDevice.

func (*RobotVacuumCleanerComboDevice) Dock added in v0.5.0

Dock sends a command to return the RobotVacuumCleanerComboDevice to its charging dock.

func (*RobotVacuumCleanerComboDevice) ExecCommand added in v0.5.0

func (device *RobotVacuumCleanerComboDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the RobotVacuumCleanerComboDevice

func (*RobotVacuumCleanerComboDevice) GetAnyStatusBody added in v0.5.0

func (device *RobotVacuumCleanerComboDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*RobotVacuumCleanerComboDevice) GetCommandParameterJSONSchema added in v0.5.0

func (device *RobotVacuumCleanerComboDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the RobotVacuumCleanerComboDevice command parameter

func (*RobotVacuumCleanerComboDevice) GetStatus added in v0.5.0

GetStatus retrieves the status of the RobotVacuumCleanerComboDevice

func (*RobotVacuumCleanerComboDevice) Pause added in v0.5.0

Pause sends a command to pause the RobotVacuumCleanerComboDevice.

func (*RobotVacuumCleanerComboDevice) SetVolume added in v0.5.0

func (device *RobotVacuumCleanerComboDevice) SetVolume(volume int) (*CommonResponse, error)

SetVolume sends a command to set the volume of the RobotVacuumCleanerComboDevice.

func (*RobotVacuumCleanerComboDevice) StartClean added in v0.5.0

func (device *RobotVacuumCleanerComboDevice) StartClean(startFloorCleaningParam *StartFloorCleaningComboParam) (*CommonResponse, error)

StartClean sends a command to start cleaning the RobotVacuumCleanerComboDevice.

type RobotVacuumCleanerComboDeviceCommandChangeParamIfExposer added in v0.5.0

type RobotVacuumCleanerComboDeviceCommandChangeParamIfExposer struct{}

RobotVacuumCleanerComboDeviceCommandChangeParamIfExposer represents the changeParam command parameters

func (*RobotVacuumCleanerComboDeviceCommandChangeParamIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RobotVacuumCleanerComboDeviceCommandChangeParamIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerComboDevice command parameter for changeParam

func (*RobotVacuumCleanerComboDeviceCommandChangeParamIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RobotVacuumCleanerComboDeviceCommandChangeParamIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerComboDevice command parameter for changeParam

type RobotVacuumCleanerComboDeviceCommandParameter added in v0.5.0

type RobotVacuumCleanerComboDeviceCommandParameter struct {
	Command    string `` /* 257-byte string literal not displayed */
	Action     string `json:"action" title:"Action" enum:"sweep,mop" description:"sweep:sweep only, mop:mop only"`
	FanLevel   int    `json:"fanLevel" title:"FanLevel" minimum:"1" maximum:"4" description:"Fan level (1-4)"`
	WaterLevel int    `json:"waterLevel" title:"WaterLevel" minimum:"1" maximum:"2" description:"Water level (1-2)"`
	Times      int    `json:"times" title:"Times" minimum:"1" maximum:"2639999" description:"the number of cycles"`
	Volume     int    `json:"volume" title:"Volume" minimum:"0" maximum:"100" description:"Volume level (0-100)"`
	// contains filtered or unexported fields
}

RobotVacuumCleanerComboDeviceCommandParameter is a struct that represents the command parameter for the RobotVacuumCleanerComboDevice

func (*RobotVacuumCleanerComboDeviceCommandParameter) JSONSchemaAllOf added in v0.5.0

func (parameter *RobotVacuumCleanerComboDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the RobotVacuumCleanerComboDevice command parameter

type RobotVacuumCleanerComboDeviceCommandSetVolumeIfExposer added in v0.5.0

type RobotVacuumCleanerComboDeviceCommandSetVolumeIfExposer struct{}

RobotVacuumCleanerComboDeviceCommandSetVolumeIfExposer represents the setVolume command parameters

func (*RobotVacuumCleanerComboDeviceCommandSetVolumeIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RobotVacuumCleanerComboDeviceCommandSetVolumeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerComboDevice command parameter for setVolume

func (*RobotVacuumCleanerComboDeviceCommandSetVolumeIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RobotVacuumCleanerComboDeviceCommandSetVolumeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerComboDevice command parameter for setVolume

type RobotVacuumCleanerComboDeviceCommandStartCleanIfExposer added in v0.5.0

type RobotVacuumCleanerComboDeviceCommandStartCleanIfExposer struct{}

RobotVacuumCleanerComboDeviceCommandStartCleanIfExposer represents the startClean command parameters

func (*RobotVacuumCleanerComboDeviceCommandStartCleanIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RobotVacuumCleanerComboDeviceCommandStartCleanIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerComboDevice command parameter for startClean

func (*RobotVacuumCleanerComboDeviceCommandStartCleanIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RobotVacuumCleanerComboDeviceCommandStartCleanIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerComboDevice command parameter for startClean

type RobotVacuumCleanerComboDeviceStatusBody added in v0.5.0

type RobotVacuumCleanerComboDeviceStatusBody struct {
	CommonDevice
	WorkingStatus string `json:"workingStatus"`
	OnlineStatus  string `json:"onlineStatus"`
	Battery       int    `json:"battery"`
	TaskType      string `json:"taskType"`
}

RobotVacuumCleanerComboDeviceStatusBody represents the status body of a Robot Vacuum Cleaner Combo device

type RobotVacuumCleanerComboDeviceStatusResponse added in v0.5.0

type RobotVacuumCleanerComboDeviceStatusResponse struct {
	CommonResponse
	Body *RobotVacuumCleanerComboDeviceStatusBody `json:"body"`
}

RobotVacuumCleanerComboDeviceStatusResponse represents the status response for a Robot Vacuum Cleaner Combo device

type RobotVacuumCleanerDevice added in v0.3.2

type RobotVacuumCleanerDevice struct {
	CommonDeviceListItem
}

func (*RobotVacuumCleanerDevice) Dock added in v0.3.2

func (device *RobotVacuumCleanerDevice) Dock() (*CommonResponse, error)

Dock sends a command to return the RobotVacuumCleanerDevice to its charging dock.

func (*RobotVacuumCleanerDevice) ExecCommand added in v0.4.0

func (device *RobotVacuumCleanerDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the RobotVacuumCleanerDevice

func (*RobotVacuumCleanerDevice) GetAnyStatusBody added in v0.3.5

func (device *RobotVacuumCleanerDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*RobotVacuumCleanerDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *RobotVacuumCleanerDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the RobotVacuumCleanerDevice command parameter

func (*RobotVacuumCleanerDevice) GetStatus added in v0.3.2

func (*RobotVacuumCleanerDevice) SetPowerLevel added in v0.3.2

func (device *RobotVacuumCleanerDevice) SetPowerLevel(powerLevel RobotVacuumCleanerPowerLevel) (*CommonResponse, error)

SetPowerLevel sends a command to set the suction power level of the RobotVacuumCleanerDevice.

func (*RobotVacuumCleanerDevice) Start added in v0.3.2

func (device *RobotVacuumCleanerDevice) Start() (*CommonResponse, error)

Start sends a command to start vacuuming the RobotVacuumCleanerDevice

func (*RobotVacuumCleanerDevice) Stop added in v0.3.2

func (device *RobotVacuumCleanerDevice) Stop() (*CommonResponse, error)

Stop sends a command to stop vacuuming the RobotVacuumCleanerDevice

type RobotVacuumCleanerDeviceCommandParameter added in v0.4.0

type RobotVacuumCleanerDeviceCommandParameter struct {
	Command    string `` /* 213-byte string literal not displayed */
	PowerLevel int    `json:"powerLevel" title:"PowerLevel" minimum:"0" maximum:"3" description:"Power level: 0:Quiet, 1:Standard, 2:Strong, 3:Max"`
	// contains filtered or unexported fields
}

RobotVacuumCleanerDeviceCommandParameter is a struct that represents the command parameter for the RobotVacuumCleanerDevice

func (*RobotVacuumCleanerDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *RobotVacuumCleanerDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the RobotVacuumCleanerDevice command parameter

type RobotVacuumCleanerDeviceCommandSetPowerLevelIfExposer added in v0.4.0

type RobotVacuumCleanerDeviceCommandSetPowerLevelIfExposer struct{}

RobotVacuumCleanerDeviceCommandSetPowerLevelIfExposer represents the SetPowerLevel command parameters

func (*RobotVacuumCleanerDeviceCommandSetPowerLevelIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *RobotVacuumCleanerDeviceCommandSetPowerLevelIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerDevice command parameter for SetPowerLevel

func (*RobotVacuumCleanerDeviceCommandSetPowerLevelIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *RobotVacuumCleanerDeviceCommandSetPowerLevelIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerDevice command parameter for SetPowerLevel

type RobotVacuumCleanerDeviceStatusBody added in v0.3.2

type RobotVacuumCleanerDeviceStatusBody struct {
	CommonDevice
	WorkingStatus string `json:"workingStatus"`
	OnlineStatus  string `json:"onlineStatus"`
	Battery       int    `json:"battery"`
}

type RobotVacuumCleanerDeviceStatusResponse added in v0.3.2

type RobotVacuumCleanerDeviceStatusResponse struct {
	CommonResponse
	Body *RobotVacuumCleanerDeviceStatusBody `json:"body"`
}

type RobotVacuumCleanerPowerLevel added in v0.3.2

type RobotVacuumCleanerPowerLevel int

RobotVacuumCleanerPowerLevel represents the power level of the RobotVacuumCleanerDevice.

type RobotVacuumCleanerSDevice added in v0.5.0

type RobotVacuumCleanerSDevice struct {
	CommonDeviceListItem
}

func (*RobotVacuumCleanerSDevice) AddWaterForHumi added in v0.5.0

func (device *RobotVacuumCleanerSDevice) AddWaterForHumi() (*CommonResponse, error)

AddWaterForHumi sends a command to refill the mind-blowing Evaporative Humidifier (Auto-refill) in the RobotVacuumCleanerSDevice.

func (*RobotVacuumCleanerSDevice) ChangeParam added in v0.5.0

func (device *RobotVacuumCleanerSDevice) ChangeParam(floorCleaningParam *FloorCleaningParam) (*CommonResponse, error)

ChangeParam sends a command to change the cleaning parameters of the RobotVacuumCleanerSDevice.

func (*RobotVacuumCleanerSDevice) Dock added in v0.5.0

func (device *RobotVacuumCleanerSDevice) Dock() (*CommonResponse, error)

Dock sends a command to return the RobotVacuumCleanerSDevice to its charging dock.

func (*RobotVacuumCleanerSDevice) ExecCommand added in v0.5.0

func (device *RobotVacuumCleanerSDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the RobotVacuumCleanerSDevice

func (*RobotVacuumCleanerSDevice) GetAnyStatusBody added in v0.5.0

func (device *RobotVacuumCleanerSDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*RobotVacuumCleanerSDevice) GetCommandParameterJSONSchema added in v0.5.0

func (device *RobotVacuumCleanerSDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the RobotVacuumCleanerSDevice command parameter

func (*RobotVacuumCleanerSDevice) GetStatus added in v0.5.0

func (*RobotVacuumCleanerSDevice) Pause added in v0.5.0

func (device *RobotVacuumCleanerSDevice) Pause() (*CommonResponse, error)

Pause sends a command to pause the RobotVacuumCleanerSDevice.

func (*RobotVacuumCleanerSDevice) SelfClean added in v0.5.0

func (device *RobotVacuumCleanerSDevice) SelfClean(mode SelfCleaningMode) (*CommonResponse, error)

SelfClean sends a command to start self-cleaning the RobotVacuumCleanerSDevice.

func (*RobotVacuumCleanerSDevice) SetVolume added in v0.5.0

func (device *RobotVacuumCleanerSDevice) SetVolume(volume int) (*CommonResponse, error)

SetVolume sends a command to set the volume of the RobotVacuumCleanerSDevice.

func (*RobotVacuumCleanerSDevice) StartClean added in v0.5.0

func (device *RobotVacuumCleanerSDevice) StartClean(startFloorCleaningParam *StartFloorCleaningParam) (*CommonResponse, error)

StartClean sends a command to start cleaning the RobotVacuumCleanerSDevice.

type RobotVacuumCleanerSDeviceCommandChangeParamIfExposer added in v0.5.0

type RobotVacuumCleanerSDeviceCommandChangeParamIfExposer struct{}

RobotVacuumCleanerSDeviceCommandChangeParamIfExposer represents the ChangeParam command parameters

func (*RobotVacuumCleanerSDeviceCommandChangeParamIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandChangeParamIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerSDevice command parameter for ChangeParam

func (*RobotVacuumCleanerSDeviceCommandChangeParamIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandChangeParamIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerSDevice command parameter for ChangeParam

type RobotVacuumCleanerSDeviceCommandParameter added in v0.5.0

type RobotVacuumCleanerSDeviceCommandParameter struct {
	Command    string `` /* 353-byte string literal not displayed */
	Action     string `json:"action" title:"Action" enum:"sweep,sweep_mop" description:"sweep:sweep only, sweep_mop:sweep and mop"`
	FanLevel   int    `json:"fanLevel" title:"FanLevel" minimum:"1" maximum:"4" description:"Fan level (1-4)"`
	WaterLevel int    `json:"waterLevel" title:"WaterLevel" minimum:"1" maximum:"2" description:"Water level (1-2)"`
	Times      int    `json:"times" title:"Times" minimum:"1" maximum:"2639999" description:"the number of cycles"`
	Volume     int    `json:"volume" title:"Volume" minimum:"0" maximum:"100" description:"Volume level (0-100)"`
	Mode       int    `json:"mode" title:"Mode" minimum:"1" maximum:"3" description:"Self-cleaning mode: 1:wash mop, 2:dry, 3:terminate"`
	// contains filtered or unexported fields
}

RobotVacuumCleanerSDeviceCommandParameter is a struct that represents the command parameter for the RobotVacuumCleanerSDevice

func (*RobotVacuumCleanerSDeviceCommandParameter) JSONSchemaAllOf added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the RobotVacuumCleanerSDevice command parameter

type RobotVacuumCleanerSDeviceCommandSelfCleanIfExposer added in v0.5.0

type RobotVacuumCleanerSDeviceCommandSelfCleanIfExposer struct{}

RobotVacuumCleanerSDeviceCommandSelfCleanIfExposer represents the SelfClean command parameters

func (*RobotVacuumCleanerSDeviceCommandSelfCleanIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandSelfCleanIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerSDevice command parameter for SelfClean

func (*RobotVacuumCleanerSDeviceCommandSelfCleanIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandSelfCleanIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerSDevice command parameter for SelfClean

type RobotVacuumCleanerSDeviceCommandSetVolumeIfExposer added in v0.5.0

type RobotVacuumCleanerSDeviceCommandSetVolumeIfExposer struct{}

RobotVacuumCleanerSDeviceCommandSetVolumeIfExposer represents the SetVolume command parameters

func (*RobotVacuumCleanerSDeviceCommandSetVolumeIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandSetVolumeIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerSDevice command parameter for SetVolume

func (*RobotVacuumCleanerSDeviceCommandSetVolumeIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandSetVolumeIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerSDevice command parameter for SetVolume

type RobotVacuumCleanerSDeviceCommandStartCleanIfExposer added in v0.5.0

type RobotVacuumCleanerSDeviceCommandStartCleanIfExposer struct{}

RobotVacuumCleanerSDeviceCommandStartCleanIfExposer represents the StartClean command parameters

func (*RobotVacuumCleanerSDeviceCommandStartCleanIfExposer) JSONSchemaIf added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandStartCleanIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the RobotVacuumCleanerSDevice command parameter for StartClean

func (*RobotVacuumCleanerSDeviceCommandStartCleanIfExposer) JSONSchemaThen added in v0.5.0

func (parameter *RobotVacuumCleanerSDeviceCommandStartCleanIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the RobotVacuumCleanerSDevice command parameter for StartClean

type RobotVacuumCleanerSDeviceStatusBody added in v0.5.0

type RobotVacuumCleanerSDeviceStatusBody struct {
	CommonDevice
	WorkingStatus    string `json:"workingStatus"`
	OnlineStatus     string `json:"onlineStatus"`
	Battery          int    `json:"battery"`
	WaterBaseBattery int    `json:"waterBaseBattery"`
	TaskType         string `json:"taskType"`
}

type RobotVacuumCleanerSDeviceStatusResponse added in v0.5.0

type RobotVacuumCleanerSDeviceStatusResponse struct {
	CommonResponse
	Body *RobotVacuumCleanerSDeviceStatusBody `json:"body"`
}

type RollerShadeDevice added in v0.3.2

type RollerShadeDevice struct {
	CommonDeviceListItem
	BleVersion         string   `json:"bleVersion"`
	GroupingDevicesIds []string `json:"groupingDevicesIds"`
	Group              bool     `json:"group"`
	Master             bool     `json:"master"`
	GroupName          string   `json:"groupName"`
}

func (*RollerShadeDevice) ExecCommand added in v0.4.0

func (device *RollerShadeDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the RollerShadeDevice

func (*RollerShadeDevice) GetAnyStatusBody added in v0.3.5

func (device *RollerShadeDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*RollerShadeDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *RollerShadeDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the RollerShadeDevice command parameter

func (*RollerShadeDevice) GetStatus added in v0.3.2

func (*RollerShadeDevice) SetPosition added in v0.3.2

func (device *RollerShadeDevice) SetPosition(position int) (*CommonResponse, error)

SetPosition sends a command to set the position of the RollerShadeDevice

type RollerShadeDeviceCommandParameter added in v0.4.0

type RollerShadeDeviceCommandParameter struct {
	Command  string `json:"command" title:"Command" enum:"SetPosition" description:"SetPosition:set position" required:"true"`
	Position int    `json:"position" title:"Position" minimum:"0" maximum:"100" description:"Position (0-100)" required:"true"`
	// contains filtered or unexported fields
}

RollerShadeDeviceCommandParameter is a struct that represents the command parameter for the RollerShadeDevice

type RollerShadeDeviceStatusBody added in v0.3.2

type RollerShadeDeviceStatusBody struct {
	CommonDevice
	Version       string `json:"version"`
	Calibrate     bool   `json:"calibrate"`
	Battery       int    `json:"battery"`
	Moving        bool   `json:"moving"`
	SlidePosition int    `json:"slidePosition"`
}

type RollerShadeDeviceStatusResponse added in v0.3.2

type RollerShadeDeviceStatusResponse struct {
	CommonResponse
	Body *RollerShadeDeviceStatusBody `json:"body"`
}

type SelfCleaningMode added in v0.3.2

type SelfCleaningMode int

type StartFloorCleaningComboParam added in v0.5.0

type StartFloorCleaningComboParam struct {
	Action FloorCleaningActionCombo `json:"action"`
	Param  FloorCleaningComboParam  `json:"param"`
}

StartFloorCleaningComboParam represents the parameters for starting floor cleaning mode for Combo devices.

func NewStartFloorCleaningComboParam added in v0.5.0

func NewStartFloorCleaningComboParam(action FloorCleaningActionCombo, fanLevel int, times int) (*StartFloorCleaningComboParam, error)

NewStartFloorCleaningComboParam creates a new StartFloorCleaningComboParam instance with validation.

type StartFloorCleaningParam added in v0.3.2

type StartFloorCleaningParam struct {
	Action FloorCleaningAction `json:"action"`
	Param  FloorCleaningParam  `json:"param"`
}

StartFloorCleaningParam represents the parameters for starting floor cleaning mode.

func NewStartFloorCleaningParam added in v0.3.2

func NewStartFloorCleaningParam(action FloorCleaningAction, fanLevel int, waterLevel int, times int) (*StartFloorCleaningParam, error)

NewStartFloorCleaningParam creates a new StartFloorCleaningParam instance with validation.

type StatusGettable added in v0.3.5

type StatusGettable interface {
	GetAnyStatusBody() (any, error)
}

StatusGettable is an interface that defines a method to get the status of a device as a value of type `any`

type StripLightDevice added in v0.3.2

type StripLightDevice struct {
	CommonDeviceListItem
}

func (*StripLightDevice) ExecCommand added in v0.4.0

func (device *StripLightDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the StripLightDevice

func (*StripLightDevice) GetAnyStatusBody added in v0.3.5

func (device *StripLightDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*StripLightDevice) GetCommandParameterJSONSchema added in v0.4.0

func (device *StripLightDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the StripLightDevice command parameter

func (*StripLightDevice) GetStatus added in v0.3.2

func (device *StripLightDevice) GetStatus() (*StripLightDeviceStatusResponse, error)

func (*StripLightDevice) SetBrightness added in v0.3.2

func (device *StripLightDevice) SetBrightness(brightness int) (*CommonResponse, error)

SetBrightness sends a command to set the brightness of the StripLightDevice

func (*StripLightDevice) SetColor added in v0.3.2

func (device *StripLightDevice) SetColor(color color.RGBA) (*CommonResponse, error)

SetColor sends a command to set the color of the StripLightDevice

func (*StripLightDevice) Toggle added in v0.3.2

func (device *StripLightDevice) Toggle() (*CommonResponse, error)

Toggle sends a command to toggle the StripLightDevice

func (*StripLightDevice) TurnOff added in v0.3.2

func (device *StripLightDevice) TurnOff() (*CommonResponse, error)

TurnOff sends a command to turn off the StripLightDevice

func (*StripLightDevice) TurnOn added in v0.3.2

func (device *StripLightDevice) TurnOn() (*CommonResponse, error)

TurnOn sends a command to turn on the StripLightDevice

type StripLightDeviceCommandParameter added in v0.4.0

type StripLightDeviceCommandParameter struct {
	Command    string `` /* 258-byte string literal not displayed */
	Brightness int    `json:"brightness" title:"Brightness" minimum:"1" maximum:"100" description:"Brightness level (1-100)"`
	Red        int    `json:"red" title:"Red" minimum:"0" maximum:"255" description:"Red color value (0-255)"`
	Green      int    `json:"green" title:"Green" minimum:"0" maximum:"255" description:"Green color value (0-255)"`
	Blue       int    `json:"blue" title:"Blue" minimum:"0" maximum:"255" description:"Blue color value (0-255)"`
	// contains filtered or unexported fields
}

StripLightDeviceCommandParameter is a struct that represents the command parameter for the StripLightDevice

func (*StripLightDeviceCommandParameter) JSONSchemaAllOf added in v0.4.0

func (parameter *StripLightDeviceCommandParameter) JSONSchemaAllOf() []interface{}

JSONSchemaAllOf returns the JSON schema allOf block for the StripLightDevice command parameter

type StripLightDeviceCommandSetBrightnessIfExposer added in v0.4.0

type StripLightDeviceCommandSetBrightnessIfExposer struct{}

StripLightDeviceCommandSetBrightnessIfExposer represents the SetBrightness command parameters

func (*StripLightDeviceCommandSetBrightnessIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *StripLightDeviceCommandSetBrightnessIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the StripLightDevice command parameter for SetBrightness

func (*StripLightDeviceCommandSetBrightnessIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *StripLightDeviceCommandSetBrightnessIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the StripLightDevice command parameter for SetBrightness

type StripLightDeviceCommandSetColorIfExposer added in v0.4.0

type StripLightDeviceCommandSetColorIfExposer struct{}

StripLightDeviceCommandSetColorIfExposer represents the SetColor command parameters

func (*StripLightDeviceCommandSetColorIfExposer) JSONSchemaIf added in v0.4.0

func (parameter *StripLightDeviceCommandSetColorIfExposer) JSONSchemaIf() interface{}

JSONSchemaIf returns the JSON schema if block for the StripLightDevice command parameter for SetColor

func (*StripLightDeviceCommandSetColorIfExposer) JSONSchemaThen added in v0.4.0

func (parameter *StripLightDeviceCommandSetColorIfExposer) JSONSchemaThen() interface{}

JSONSchemaThen returns the JSON schema then block for the StripLightDevice command parameter for SetColor

type StripLightDeviceStatusBody added in v0.3.2

type StripLightDeviceStatusBody struct {
	CommonDevice
	Power      string `json:"power"`
	Version    string `json:"version"`
	Brightness int    `json:"brightness"`
	Color      string `json:"color"`
}

type StripLightDeviceStatusResponse added in v0.3.2

type StripLightDeviceStatusResponse struct {
	CommonResponse
	Body *StripLightDeviceStatusBody `json:"body"`
}

type SwitchableDevice added in v0.3.5

type SwitchableDevice interface {
	TurnOn() (*CommonResponse, error)
	TurnOff() (*CommonResponse, error)
}

SwitchableDevice represents a device that can be switched ON or OFF.

type VideoDoorbellDevice added in v0.5.0

type VideoDoorbellDevice struct {
	CommonDeviceListItem
}

VideoDoorbellDevice represents a SwitchBot Video Doorbell device

func (*VideoDoorbellDevice) DisableMotionDetection added in v0.5.0

func (device *VideoDoorbellDevice) DisableMotionDetection() (*CommonResponse, error)

DisableMotionDetection disables motion detection on the Video Doorbell

func (*VideoDoorbellDevice) EnableMotionDetection added in v0.5.0

func (device *VideoDoorbellDevice) EnableMotionDetection() (*CommonResponse, error)

EnableMotionDetection enables motion detection on the Video Doorbell

func (*VideoDoorbellDevice) ExecCommand added in v0.5.0

func (device *VideoDoorbellDevice) ExecCommand(jsonString string) (*CommonResponse, error)

ExecCommand sends a command to the VideoDoorbellDevice

func (*VideoDoorbellDevice) GetAnyStatusBody added in v0.5.0

func (device *VideoDoorbellDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*VideoDoorbellDevice) GetCommandParameterJSONSchema added in v0.5.0

func (device *VideoDoorbellDevice) GetCommandParameterJSONSchema() (string, error)

GetCommandParameterJSONSchema returns the JSON schema for the VideoDoorbellDevice command parameter

func (*VideoDoorbellDevice) GetStatus added in v0.5.0

GetStatus retrieves the current status of the VideoDoorbellDevice

type VideoDoorbellDeviceCommandParameter added in v0.5.0

type VideoDoorbellDeviceCommandParameter struct {
	Command string `` /* 207-byte string literal not displayed */
	// contains filtered or unexported fields
}

VideoDoorbellDeviceCommandParameter is a struct that represents the command parameter for the VideoDoorbellDevice

type VideoDoorbellDeviceStatusBody added in v0.5.0

type VideoDoorbellDeviceStatusBody struct {
	CommonDevice
	Online  bool   `json:"online"`
	Battery int    `json:"battery"`
	Version string `json:"version"`
}

VideoDoorbellDeviceStatusBody represents the status body of a Video Doorbell device

type VideoDoorbellDeviceStatusResponse added in v0.5.0

type VideoDoorbellDeviceStatusResponse struct {
	CommonResponse
	Body *VideoDoorbellDeviceStatusBody `json:"body"`
}

VideoDoorbellDeviceStatusResponse represents the status response for a Video Doorbell device

type WaterLeakDetectorDevice added in v0.3.2

type WaterLeakDetectorDevice struct {
	CommonDeviceListItem
}

func (*WaterLeakDetectorDevice) GetAnyStatusBody added in v0.3.5

func (device *WaterLeakDetectorDevice) GetAnyStatusBody() (any, error)

GetAnyStatusBody returns the status of the device as a value of type `any`

func (*WaterLeakDetectorDevice) GetStatus added in v0.3.2

type WaterLeakDetectorDeviceStatusBody added in v0.3.2

type WaterLeakDetectorDeviceStatusBody struct {
	CommonDevice
	Battery int    `json:"battery"`
	Version string `json:"version"`
	Status  bool   `json:"status"`
}

type WaterLeakDetectorDeviceStatusResponse added in v0.3.2

type WaterLeakDetectorDeviceStatusResponse struct {
	CommonResponse
	Body *WaterLeakDetectorDeviceStatusBody `json:"body"`
}

Directories

Path Synopsis
examples
command_device command
get_devices command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL