Documentation ¶
Index ¶
Constants ¶
const DeconzDiscoveryEndpoint = "https://dresden-light.appspot.com/discover"
DeconzDiscoveryEndpoint is the url used when auto discovering a deconz gateway
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Config Config // contains filtered or unexported fields }
API represents the deCONZ rest api
func (*API) DeviceEventReader ¶
func (a *API) DeviceEventReader(r *event.Reader) *DeviceEventReader
DeviceEventReader takes an event reader and returns an sensor event reader
type CachedDeviceStore ¶
type CachedDeviceStore struct { DeviceGetter // contains filtered or unexported fields }
CachedDeviceStore is a cached typestore which provides LookupType for event passing it will be our default store
func (*CachedDeviceStore) LookupDevice ¶
func (c *CachedDeviceStore) LookupDevice(id string) (*Device, error)
LookupDevice returns a device for an device id
func (*CachedDeviceStore) LookupType ¶
func (c *CachedDeviceStore) LookupType(id string) (string, error)
LookupType lookups deCONZ event types though a cache TODO: if we where unable to lookup an ID we should try to refetch the cache - there could have been an device added we dont know about
func (*CachedDeviceStore) SupportsResource ¶
func (c *CachedDeviceStore) SupportsResource(restype string) bool
SupportsResource returns true if this Store supports the resource type
type DeviceEvent ¶
DeviceEvent is a sensor and a event embedded
type DeviceEventReader ¶
type DeviceEventReader struct {
// contains filtered or unexported fields
}
DeviceEventReader reads events from an event.reader and returns DeviceEvents
func (*DeviceEventReader) Start ¶
func (r *DeviceEventReader) Start(out chan *DeviceEvent) error
Start starts a thread reading events into the given channel returns immediately
func (*DeviceEventReader) StopReadEvents ¶
func (r *DeviceEventReader) StopReadEvents()
StopReadEvents closes the reader, closing the connection to deconz and terminating the goroutine
type DeviceGetter ¶
DeviceGetter defines how we like to ask for devices
type DeviceLookup ¶
DeviceLookup represents an interface for device lookup
type Discovery ¶
type Discovery struct { ID string Name string MacAddress string PublicIPAddress string InternalIPAddress string InternalPort uint }
Discovery is a discovered deconz gateway [{"macaddress": "00212EFFFF017FBD", "name": "deCONZ-GW", "internalipaddress": "192.168.1.90", "publicipaddress": "85.191.222.130", "internalport": 8080, "id": "00212EFFFF017FBD"}]
type DiscoveryResponse ¶
type DiscoveryResponse []Discovery
DiscoveryResponse is a slice of discovered gateways