wemo

package
v0.0.0-...-a7f72a6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package wemo controls Belkin WeMo devices using their SOAP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Host         string
	FriendlyName string
}

Device models a WeMo device.

func DiscoverDevices

func DiscoverDevices() ([]*Device, error)

DiscoverDevices finds all the Wemo Switch or Insight Switches on the network.

func NewDevice

func NewDevice(host string) (*Device, error)

NewDevice sets up a new Device instance. A connection is made to the device to lookup basic properties.

func (*Device) SetState

func (d *Device) SetState(state bool) error

SetState sets the state of the device. An error is returned if it fails to do so. In this author's experience, errors are fairly common so retry logic should be used.

func (*Device) State

func (d *Device) State() (bool, error)

State gets the state of the Device. An error is returned if the state cannot be looked up.

Jump to

Keyboard shortcuts

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