sdk

package
v0.0.0-...-6bc0167 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceSupportsCapability

func DeviceSupportsCapability(capability string, device Device) bool

DeviceSupportsCapability check device capability

Types

type App

type App struct {
	AppName     string `json:"appName"`
	AppID       string `json:"appId"`
	AppType     string `json:"appType"`
	DisplayName string `json:"displayName"`
	Description string `json:"description"`
	Owner       struct {
		OwnerType string `json:"ownerType"`
		OwnerID   string `json:"ownerId"`
	} `json:"owner"`
	WebhookSmartApp struct {
		TargetURL string `json:"targetUrl"`
		PublicKey string `json:"publicKey"`
	} `json:"webhookSmartApp"`
	CreatedDate     time.Time `json:"createdDate"`
	LastUpdatedDate time.Time `json:"lastUpdatedDate"`
}

App holds application details

type AppCreate

type AppCreate struct {
	AppName         string         `json:"appName"`
	DisplayName     string         `json:"displayName"`
	Description     string         `json:"description"`
	SingleInstance  bool           `json:"singleInstance"`
	AppType         string         `json:"appType"`
	Classifications string         `json:"classifications,omitempty"`
	LambdaSmartApp  LambdaSmartApp `json:"lambdaSmartApp"`
	WebhookSmartApp struct {
		TargetURL string `json:"targetUrl"`
	} `json:"webhookSmartApp,omitempty"`
}

AppCreate application creation request

type AppList

type AppList struct {
	Items []struct {
		AppName     string `json:"appName"`
		AppID       string `json:"appId"`
		AppType     string `json:"appType"`
		DisplayName string `json:"displayName"`
		Description string `json:"description"`
		Owner       struct {
			OwnerType string `json:"ownerType"`
			OwnerID   string `json:"ownerId"`
		} `json:"owner"`
		CreatedDate     time.Time `json:"createdDate"`
		LastUpdatedDate time.Time `json:"lastUpdatedDate"`
	} `json:"items"`
	Links struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

AppList application list structure

type AppOauthSecret

type AppOauthSecret struct {
	OauthClientDetails struct {
		ClientName string   `json:"clientName"`
		Scope      []string `json:"scope"`
	} `json:"oauthClientDetails"`
	OauthClientID     string `json:"oauthClientId"`
	OauthClientSecret string `json:"oauthClientSecret"`
}

AppOauthSecret secret details

type AppOauthSettings

type AppOauthSettings struct {
	ClientName string   `json:"clientName"`
	Scope      []string `json:"scope"`
}

AppOauthSettings app oauth settings

type AppSettings

type AppSettings struct {
	Settings struct {
		Properties map[string]string
	} `json:"settings"`
}

AppSettings holds application configuration settings

type ColorControl

type ColorControl struct {
	Hue        int    `json:"hue,omitempty"`
	Saturation int    `json:"saturation,omitempty"`
	Hex        string `json:"hex,omitempty"`
	Level      int    `json:"level,omitempty"`
	Switch     string `json:"switch,omitempty"`
}

ColorControl color command request details

type Commands

type Commands struct {
	DeviceCommands []DeviceCommand `json:"commands"`
}

Commands commands array

type Device

type Device struct {
	DeviceID               string `json:"deviceId"`
	Name                   string `json:"name"`
	Label                  string `json:"label"`
	DeviceManufacturerCode string `json:"deviceManufacturerCode"`
	LocationID             string `json:"locationId"`
	DeviceTypeID           string `json:"deviceTypeId"`
	DeviceTypeName         string `json:"deviceTypeName"`
	DeviceNetworkType      string `json:"deviceNetworkType"`
	Components             []struct {
		ID           string                    `json:"id"`
		Capabilities []DeviceProfileCapability `json:"capabilities"`
	} `json:"components"`
	App struct {
		InstalledAppID string `json:"installedAppId"`
		ExternalID     string `json:"externalId"`
		Profile        struct {
			ID string `json:"id"`
		} `json:"profile"`
	} `json:"app"`
	Dth struct {
		DeviceTypeID      string `json:"deviceTypeId"`
		DeviceTypeName    string `json:"deviceTypeName"`
		DeviceNetworkType string `json:"deviceNetworkType"`
	} `json:"dth"`
	Type string `json:"type"`
}

Device holds device structure

type DeviceCommand

type DeviceCommand struct {
	Component  string                   `json:"component"`
	Capability string                   `json:"capability"`
	Command    string                   `json:"command"`
	Arguments  []map[string]interface{} `json:"arguments"`
}

DeviceCommand device command request

func NewColorControl

func NewColorControl(hue int, saturation int, hex string, level int) DeviceCommand

NewColorControl control light settings

func NewColorControlHex

func NewColorControlHex(hex string) DeviceCommand

NewColorControlHex change light color

func NewColorControlHue

func NewColorControlHue(hue int) DeviceCommand

NewColorControlHue change light hue setting

func NewColorControlLevel

func NewColorControlLevel(level int) DeviceCommand

NewColorControlLevel change light level

func NewColorControlLevelRate

func NewColorControlLevelRate(level int, rate int) DeviceCommand

NewColorControlLevelRate change light level and change rate

func NewColorControlSaturation

func NewColorControlSaturation(saturation int) DeviceCommand

NewColorControlSaturation change light saturation

func NewColorTemperature

func NewColorTemperature(temperature int) DeviceCommand

NewColorTemperature change light temperature

func NewSwitchLevel

func NewSwitchLevel(level int) DeviceCommand

NewSwitchLevel change switch level

func NewSwitchOff

func NewSwitchOff() DeviceCommand

NewSwitchOff turn off switch

func NewSwitchOn

func NewSwitchOn() DeviceCommand

NewSwitchOn turn on switch

type DeviceComponentStatus

type DeviceComponentStatus struct {
	Actuator *struct {
	} `json:"actuator"`
	ColorControl *struct {
		Color struct {
			Value string `json:"value"`
		} `json:"color"`
		Hue struct {
			Value int `json:"value"`
		} `json:"hue"`
		Saturation struct {
			Value int `json:"value"`
		} `json:"saturation"`
	} `json:"colorControl"`
	ColorTemperature *struct {
		ColorTemperature struct {
			Unit  string `json:"unit"`
			Value int    `json:"value"`
		} `json:"colorTemperature"`
	} `json:"colorTemperature"`
	Battery *struct {
		Battery struct {
			Unit  string `json:"unit"`
			Value int    `json:"value"`
		} `json:"battery"`
	} `json:"battery"`
	Configuration *struct {
	} `json:"configuration"`
	ContactSensor *struct {
		Contact struct {
			Value string `json:"value"`
		} `json:"contact"`
	} `json:"contactSensor"`
	Button *struct {
		Button struct {
			Value string `json:"value"`
		} `json:"button"`
		NumberOfButtons struct {
			Value int `json:"value"`
		} `json:"numberOfButtons"`
		SupportedButtonValues struct {
			Value interface{} `json:"value"`
		} `json:"supportedButtonValues"`
	} `json:"button"`
	Bridge *struct {
	} `json:"bridge"`
	HealthCheck *struct {
		DeviceWatchDeviceStatus struct {
			Data struct {
			} `json:"data"`
			Value *string `json:"value"`
		} `json:"DeviceWatch-DeviceStatus"`
		CheckInterval struct {
			Data struct {
				HubHardwareID string `json:"hubHardwareId"`
				Protocol      string `json:"protocol"`
			} `json:"data"`
			Unit  string `json:"unit"`
			Value int    `json:"value"`
		} `json:"checkInterval"`
		HealthStatus struct {
			Data struct {
			} `json:"data"`
			Value string `json:"value"`
		} `json:"healthStatus"`
	} `json:"healthCheck"`
	OccupancySensor *struct {
		Occupancy struct {
			Value string `json:"value"`
		} `json:"occupancy"`
	} `json:"occupancySensor"`
	PresenceSensor *struct {
		Presence struct {
			Value string `json:"value"`
		} `json:"presence"`
	} `json:"presenceSensor"`
	PowerMeter *struct {
		Power struct {
			Unit  string `json:"unit"`
			Value string `json:"value"`
		} `json:"power"`
	} `json:"powerMeter"`
	IlluminanceMeasurement *struct {
		Illuminance struct {
			Unit  string `json:"unit"`
			Value int    `json:"value"`
		} `json:"illuminance"`
	} `json:"illuminanceMeasurement"`
	MotionSensor *struct {
		Motion struct {
			Value string `json:"value"`
		} `json:"motion"`
	} `json:"motionSensor"`
	Light *struct {
		Switch struct {
			Value string `json:"value"`
		} `json:"switch"`
	} `json:"light"`
	ThreeAxis *struct {
		ThreeAxis struct {
			Unit  string `json:"unit"`
			Value []int  `json:"value"`
		} `json:"threeAxis"`
	} `json:"threeAxis"`
	TemperatureMeasurement *struct {
		Temperature struct {
			Unit  string `json:"unit"`
			Value int    `json:"value"`
		} `json:"temperature"`
	} `json:"temperatureMeasurement"`
	Refresh *struct {
	} `json:"refresh"`
	RelativeHumidityMeasurement *struct {
		Humidity struct {
			Unit  string `json:"unit"`
			Value int    `json:"value"`
		} `json:"humidity"`
	} `json:"relativeHumidityMeasurement"`
	Sensor *struct {
	} `json:"sensor"`
	Switch *struct {
		Switch struct {
			Value string `json:"value"`
		} `json:"switch"`
	} `json:"switch"`
	SwitchLevel *struct {
		Level struct {
			Unit  string `json:"unit"`
			Value int    `json:"value"`
		} `json:"level"`
	} `json:"switchLevel"`
	WaterSensor *struct {
		Water struct {
			Value string `json:"value"`
		} `json:"water"`
	} `json:"waterSensor"`
}

DeviceComponentStatus hold information about various device statuses

type DeviceEvent

type DeviceEvent struct {
	Component  string      `json:"component"`
	Capability string      `json:"capability"`
	Attribute  string      `json:"attribute"`
	Value      interface{} `json:"value"`
	Unit       interface{} `json:"unit"`
}

DeviceEvent device event details

type DeviceEventList

type DeviceEventList struct {
	DeviceEvents []DeviceEvent `json:"deviceEvents"`
}

DeviceEventList structure holds all device events

type DeviceInstall

type DeviceInstall struct {
	Label      string           `json:"label"`
	LocationID string           `json:"locationId"`
	App        DeviceInstallApp `json:"app"`
}

DeviceInstall device installation details

type DeviceInstallApp

type DeviceInstallApp struct {
	ProfileID      string `json:"profileId"`
	InstalledAppID string `json:"installedAppId"`
	ExternalID     string `json:"externalId"`
}

DeviceInstallApp device application install details

type DeviceList

type DeviceList struct {
	Devices []Device `json:"items"`
	Links   struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

DeviceList holds devices array

type DeviceMetadata

type DeviceMetadata struct {
	DthName      string `json:"dthName"`
	DthNamespace string `json:"dthNamespace"`
}

DeviceMetadata stores device metadata details

type DeviceProfile

type DeviceProfile struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Owner struct {
		OwnerType string `json:"ownerType"`
		OwnerID   string `json:"ownerId"`
	} `json:"owner"`
	Components []DeviceProfileComponent `json:"components"`
	Metadata   DeviceMetadata           `json:"metadata"`
}

DeviceProfile stores device profile details

type DeviceProfileCapability

type DeviceProfileCapability struct {
	ID      string `json:"id"`
	Version int    `json:"version"`
}

DeviceProfileCapability stores device capability name and ID

type DeviceProfileComponent

type DeviceProfileComponent struct {
	ID           string                    `json:"id"`
	Capabilities []DeviceProfileCapability `json:"capabilities"`
}

DeviceProfileComponent stores capability array

type DeviceProfileCreate

type DeviceProfileCreate struct {
	Name       string                   `json:"name"`
	Components []DeviceProfileComponent `json:"components"`
	Metadata   DeviceMetadata           `json:"metadata"`
}

DeviceProfileCreate request to create device profile

type DeviceProfileList

type DeviceProfileList struct {
	Items []DeviceProfile `json:"items"`
	Links struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

DeviceProfileList holds details about all device profiles

type DeviceStatus

type DeviceStatus struct {
	Component map[string]DeviceComponentStatus `json:"components"`
}

DeviceStatus device component status details

type DeviceSubscription

type DeviceSubscription struct {
	ID             string `json:"id"`
	InstalledAppID string `json:"installedAppId"`
	SourceType     string `json:"sourceType"`
	Device         struct {
		ComponentID      string `json:"componentId"`
		DeviceID         string `json:"deviceId"`
		Capability       string `json:"capability"`
		Attribute        string `json:"attribute"`
		StateChangeOnly  string `json:"stateChangeOnly"`
		SubscriptionName string `json:"subscriptionName"`
		Value            string `json:"value"`
	} `json:"device"`
}

DeviceSubscription device description details

type InstalledAppConfig

type InstalledAppConfig struct {
	InstalledAppID      string    `json:"installedAppId"`
	ConfigurationID     string    `json:"configurationId"`
	ConfigurationStatus string    `json:"configurationStatus"`
	CreatedDate         time.Time `json:"createdDate"`
	LastUpdatedDate     time.Time `json:"lastUpdatedDate"`
	Config              struct {
		Switches []struct {
			ValueType    string `json:"valueType"`
			DeviceConfig struct {
				DeviceID    string   `json:"deviceId"`
				ComponentID string   `json:"componentId"`
				Permissions []string `json:"permissions"`
			} `json:"deviceConfig"`
		} `json:"switches"`
	} `json:"config"`
}

InstalledAppConfig application configuration

type InstalledAppConfigList

type InstalledAppConfigList struct {
	Items []struct {
		InstalledAppID      string    `json:"installedAppId"`
		ConfigurationID     string    `json:"configurationId"`
		ConfigurationStatus string    `json:"configurationStatus"`
		CreatedDate         time.Time `json:"createdDate"`
		LastUpdatedDate     time.Time `json:"lastUpdatedDate"`
	} `json:"items"`
	Links struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

InstalledAppConfigList installed application config list

type InstalledAppList

type InstalledAppList struct {
	Items []struct {
		InstalledAppID     string `json:"installedAppId"`
		InstalledAppType   string `json:"installedAppType"`
		InstalledAppStatus string `json:"installedAppStatus"`
		DisplayName        string `json:"displayName"`
		AppID              string `json:"appId"`
		ReferenceID        string `json:"referenceId"`
		LocationID         string `json:"locationId"`
		Owner              struct {
			OwnerType string `json:"ownerType"`
			OwnerID   string `json:"ownerId"`
		} `json:"owner"`
		CreatedDate     time.Time `json:"createdDate"`
		LastUpdatedDate time.Time `json:"lastUpdatedDate"`
	} `json:"items"`
	Links struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

InstalledAppList installed applications list

type LambdaSmartApp

type LambdaSmartApp struct {
	Functions []string `json:"functions"`
}

LambdaSmartApp smartapp lambda function ARN

type Location

type Location struct {
	LocationID       string  `json:"locationId"`
	Name             string  `json:"name"`
	Latitude         float64 `json:"latitude"`
	Longitude        float64 `json:"longitude"`
	RegionRadius     int     `json:"regionRadius"`
	TemperatureScale string  `json:"temperatureScale"`
	TimeZoneID       string  `json:"timeZoneId"`
	Locale           string  `json:"locale"`
}

Location details structure

type LocationList

type LocationList struct {
	Items []struct {
		LocationID string `json:"locationId"`
		Name       string `json:"name"`
	} `json:"items"`
	Links struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

LocationList location list response structure

type LocationUpdate

type LocationUpdate struct {
	Name             string  `json:"name"`
	Latitude         float64 `json:"latitude"`
	Longitude        float64 `json:"longitude"`
	RegionRadius     int     `json:"regionRadius"`
	TemperatureScale string  `json:"temperatureScale"`
	Locale           string  `json:"locale"`
}

LocationUpdate location update request

type SceneList

type SceneList struct {
	Items []struct {
		SceneID                      string `json:"sceneId"`
		SceneName                    string `json:"sceneName"`
		SceneIcon                    string `json:"sceneIcon"`
		SceneColor                   string `json:"sceneColor"`
		BehaviorID                   string `json:"behaviorId"`
		LocationID                   string `json:"locationId"`
		CreatedBy                    string `json:"createdBy"`
		CreatedDateMilliseconds      int64  `json:"createdDate"`
		LastUpdatedDateMilliseconds  int64  `json:"lastUpdatedDate"`
		LastExecutedDateMilliseconds int64  `json:"lastExecutedDate"`
		Editable                     bool   `json:"editable"`
		APIVersion                   string `json:"apiVersion"`
	} `json:"items"`
	Links struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

SceneList stores all scenes

type Schedule

type Schedule struct {
	InstalledAppID      string  `json:"installedAppId"`
	ScheduledExecutions []int64 `json:"scheduledExecutions"`
	Name                string  `json:"name"`
	Cron                struct {
		Expression string `json:"expression"`
		Timezone   string `json:"timezone"`
	} `json:"cron"`
}

Schedule schedule details

type ScheduleCreate

type ScheduleCreate struct {
	Name string       `json:"name"`
	Cron ScheduleCron `json:"cron"`
}

ScheduleCreate schedule creation request structure

type ScheduleCron

type ScheduleCron struct {
	Expression string `json:"expression"`
	Timezone   string `json:"timezone"`
}

ScheduleCron cron schedule details

type ScheduleList

type ScheduleList struct {
	Items []struct {
		ScheduledExecutions []int64 `json:"scheduledExecutions"`
		Name                string  `json:"name"`
		Cron                struct {
			Expression string `json:"expression"`
			Timezone   string `json:"timezone"`
		} `json:"cron"`
		InstalledAppID string `json:"installedAppId"`
		LocationID     string `json:"locationId"`
	} `json:"items"`
	Links struct {
		Next     interface{} `json:"next"`
		Previous interface{} `json:"previous"`
	} `json:"_links"`
}

ScheduleList stores all schedules

type SmartThingsClient

type SmartThingsClient struct {
	BaseURL   *url.URL
	UserAgent string

	HTTPClient *http.Client
}

SmartThingsClient hold sdk configuration structures

func NewClient

func NewClient(token string) *SmartThingsClient

NewClient create new sdk instance

func NewClientCustomHTTP

func NewClientCustomHTTP(client *http.Client) *SmartThingsClient

NewClientCustomHTTP create new custom sdk instance

func (*SmartThingsClient) AppCreate

func (c *SmartThingsClient) AppCreate(appCreate AppCreate) (*App, error)

AppCreate create new application

func (*SmartThingsClient) AppDelete

func (c *SmartThingsClient) AppDelete(app string) error

AppDelete delete installed application details

func (*SmartThingsClient) AppGenerateOauthSettings

func (c *SmartThingsClient) AppGenerateOauthSettings(app string, settings AppOauthSettings) (*AppOauthSecret, error)

AppGenerateOauthSettings generate oauth settings

func (*SmartThingsClient) AppGet

func (c *SmartThingsClient) AppGet(app string) (*App, error)

AppGet get application details

func (*SmartThingsClient) AppGetOauthSettings

func (c *SmartThingsClient) AppGetOauthSettings(app string) (*AppOauthSettings, error)

AppGetOauthSettings get oauth configuration

func (*SmartThingsClient) AppGetSettings

func (c *SmartThingsClient) AppGetSettings(app string) (*AppSettings, error)

AppGetSettings get application settings

func (*SmartThingsClient) AppList

func (c *SmartThingsClient) AppList() (*AppList, error)

AppList list all installed applications

func (*SmartThingsClient) AppListByPage

func (c *SmartThingsClient) AppListByPage(href string) (*AppList, error)

AppListByPage list applications by page URL

func (*SmartThingsClient) AppUpdate

func (c *SmartThingsClient) AppUpdate(appCreate AppCreate) (*App, error)

AppUpdate update existing application details

func (*SmartThingsClient) AppUpdateOauthSettings

func (c *SmartThingsClient) AppUpdateOauthSettings(app string, settings AppOauthSettings) (*AppOauthSettings, error)

AppUpdateOauthSettings update oauth settings

func (*SmartThingsClient) AppUpdateSettings

func (c *SmartThingsClient) AppUpdateSettings(appID string, settings AppSettings) (*AppSettings, error)

AppUpdateSettings update application settings

func (*SmartThingsClient) DeviceCommand

func (c *SmartThingsClient) DeviceCommand(deviceID string, command ...DeviceCommand) error

DeviceCommand run device command

func (*SmartThingsClient) DeviceComponentStatus

func (c *SmartThingsClient) DeviceComponentStatus(deviceID string, component string) (*DeviceComponentStatus, error)

DeviceComponentStatus get device component status

func (*SmartThingsClient) DeviceCreateEvent

func (c *SmartThingsClient) DeviceCreateEvent(deviceID string, command ...DeviceEvent) error

DeviceCreateEvent create device event

func (*SmartThingsClient) DeviceDelete

func (c *SmartThingsClient) DeviceDelete(deviceID string) error

DeviceDelete delete device

func (*SmartThingsClient) DeviceDescription

func (c *SmartThingsClient) DeviceDescription(deviceID string) (*Device, error)

DeviceDescription get device description

func (*SmartThingsClient) DeviceFullStatus

func (c *SmartThingsClient) DeviceFullStatus(deviceID string) (*DeviceStatus, error)

DeviceFullStatus get device full status

func (*SmartThingsClient) DeviceInstall

func (c *SmartThingsClient) DeviceInstall(deviceInstallReq DeviceInstall) (*Device, error)

DeviceInstall install device

func (*SmartThingsClient) DeviceProfileCreate

func (c *SmartThingsClient) DeviceProfileCreate(profile *DeviceProfileCreate) (*DeviceProfile, error)

DeviceProfileCreate create device profile

func (*SmartThingsClient) DeviceProfileDelete

func (c *SmartThingsClient) DeviceProfileDelete(profileID string) error

DeviceProfileDelete delete device profile

func (*SmartThingsClient) DeviceProfileList

func (c *SmartThingsClient) DeviceProfileList() (*DeviceProfileList, error)

DeviceProfileList list device profiles

func (*SmartThingsClient) DeviceProfileListByPage

func (c *SmartThingsClient) DeviceProfileListByPage(href string) (*DeviceProfileList, error)

DeviceProfileListByPage list device profiles by page URL

func (*SmartThingsClient) DeviceUpdateLabel

func (c *SmartThingsClient) DeviceUpdateLabel(deviceID string, label string) (*Device, error)

DeviceUpdateLabel update device label

func (*SmartThingsClient) DeviceUpdateProperty

func (c *SmartThingsClient) DeviceUpdateProperty(deviceID string, property string, value interface{}) (*Device, error)

DeviceUpdateProperty update device property

func (*SmartThingsClient) DevicesList

func (c *SmartThingsClient) DevicesList() (*DeviceList, error)

DevicesList list all devices

func (*SmartThingsClient) DevicesListByPage

func (c *SmartThingsClient) DevicesListByPage(href string) (*DeviceList, error)

DevicesListByPage list all devices by page URL

func (*SmartThingsClient) InstalledAppConfigListByPage

func (c *SmartThingsClient) InstalledAppConfigListByPage(href string) (*InstalledAppConfigList, error)

InstalledAppConfigListByPage get installed application config by page URL

func (*SmartThingsClient) InstalledAppDelete

func (c *SmartThingsClient) InstalledAppDelete(app string) error

InstalledAppDelete delete installed appplication

func (*SmartThingsClient) InstalledAppList

func (c *SmartThingsClient) InstalledAppList() (*InstalledAppList, error)

InstalledAppList list all installed applications

func (*SmartThingsClient) InstalledAppListByPage

func (c *SmartThingsClient) InstalledAppListByPage(href string) (*InstalledAppList, error)

InstalledAppListByPage list installed applications by page URl

func (*SmartThingsClient) InstalledConfig

func (c *SmartThingsClient) InstalledConfig(app string, configID string) (*InstalledAppConfig, error)

InstalledConfig get install application config by config ID

func (*SmartThingsClient) InstalledConfigList

func (c *SmartThingsClient) InstalledConfigList(app string) (*InstalledAppConfigList, error)

InstalledConfigList get installed applications config

func (*SmartThingsClient) LocationDelete

func (c *SmartThingsClient) LocationDelete(locationID string) error

LocationDelete delete location

func (*SmartThingsClient) LocationGet

func (c *SmartThingsClient) LocationGet(locationID string) (*Location, error)

LocationGet get location by ID

func (*SmartThingsClient) LocationUpdate

func (c *SmartThingsClient) LocationUpdate(locationID string, locationUpdate LocationUpdate) (*Location, error)

LocationUpdate update location

func (*SmartThingsClient) LocationsList

func (c *SmartThingsClient) LocationsList() (*LocationList, error)

LocationsList get all locations

func (*SmartThingsClient) LocationsListByPage

func (c *SmartThingsClient) LocationsListByPage(href string) (*LocationList, error)

LocationsListByPage get all locations by page

func (*SmartThingsClient) SceneExecute

func (c *SmartThingsClient) SceneExecute(sceneID string) error

SceneExecute executes scene

func (*SmartThingsClient) SceneList

func (c *SmartThingsClient) SceneList() (*SceneList, error)

SceneList list all scenes

func (*SmartThingsClient) SceneListByPage

func (c *SmartThingsClient) SceneListByPage(href string) (*SceneList, error)

SceneListByPage list scenes by page URL

func (*SmartThingsClient) ScheduleCreate

func (c *SmartThingsClient) ScheduleCreate(app string, scheduleCreate ScheduleCreate) (*Schedule, error)

ScheduleCreate creates schedule

func (*SmartThingsClient) ScheduleDelete

func (c *SmartThingsClient) ScheduleDelete(app string, scheduleID string) error

ScheduleDelete deletes schedule

func (*SmartThingsClient) ScheduleDeleteAll

func (c *SmartThingsClient) ScheduleDeleteAll(app string) error

ScheduleDeleteAll deletes all application schedules

func (*SmartThingsClient) ScheduleGet

func (c *SmartThingsClient) ScheduleGet(app string, scheduleID string) (*Schedule, error)

ScheduleGet get schedule by schedule ID

func (*SmartThingsClient) ScheduleList

func (c *SmartThingsClient) ScheduleList(app string) (*ScheduleList, error)

ScheduleList list all schedules

func (*SmartThingsClient) ScheduleListByPage

func (c *SmartThingsClient) ScheduleListByPage(href string) (*ScheduleList, error)

ScheduleListByPage list schedules by page URL

func (*SmartThingsClient) SubscriptionDelete

func (c *SmartThingsClient) SubscriptionDelete(app string, subscriptionID string) error

SubscriptionDelete deletes subscription

func (*SmartThingsClient) SubscriptionDeleteAll

func (c *SmartThingsClient) SubscriptionDeleteAll(app string) error

SubscriptionDeleteAll deletes all subscriptions

func (*SmartThingsClient) SubscriptionGet

func (c *SmartThingsClient) SubscriptionGet(app string, subscriptionID string) (*DeviceSubscription, error)

SubscriptionGet gets subscriptions details

func (*SmartThingsClient) SubscriptionList

func (c *SmartThingsClient) SubscriptionList(app string) (*SubscriptionList, error)

SubscriptionList get all available subscriptions

func (*SmartThingsClient) SubscriptionListByPage

func (c *SmartThingsClient) SubscriptionListByPage(href string) (*SubscriptionList, error)

SubscriptionListByPage get all available subscriptions by page URL

type SubscriptionList

type SubscriptionList struct {
	Items []struct {
		ID             string `json:"id"`
		InstalledAppID string `json:"installedAppId"`
		SourceType     string `json:"sourceType"`
		Device         struct {
			ComponentID      string `json:"componentId"`
			DeviceID         string `json:"deviceId"`
			Capability       string `json:"capability"`
			Attribute        string `json:"attribute"`
			StateChangeOnly  string `json:"stateChangeOnly"`
			SubscriptionName string `json:"subscriptionName"`
			Value            string `json:"value"`
		} `json:"device"`
	} `json:"items"`
	Links struct {
		Next struct {
			Href string `json:"href"`
		} `json:"next"`
		Previous struct {
			Href string `json:"href"`
		} `json:"previous"`
	} `json:"_links"`
}

SubscriptionList stores all subscriptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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