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) EventReader ¶
EventReader returns a event.Reader with a default cached type store
func (*API) SensorEventReader ¶
func (a *API) SensorEventReader(r *event.Reader) *SensorEventReader
SensorEventReader takes an event reader and returns an sensor event reader
type CachedSensorStore ¶
type CachedSensorStore struct { SensorGetter // contains filtered or unexported fields }
CachedSensorStore is a cached typestore which provides LookupType for event passing it will be our default store
func (*CachedSensorStore) LookupSensor ¶
func (c *CachedSensorStore) LookupSensor(i int) (*Sensor, error)
LookupSensor returns a sensor for an sensor id
func (*CachedSensorStore) LookupType ¶
func (c *CachedSensorStore) LookupType(i int) (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 sensor added we dont know about
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
type EventReader ¶
EventReader interface
type Sensor ¶
Sensor is a deCONZ sensor, not that we only implement fields needed for event parsing to work
type SensorEvent ¶
SensorEvent is a sensor and a event embedded
func (*SensorEvent) Timeseries ¶
func (s *SensorEvent) Timeseries() (map[string]string, map[string]interface{}, error)
Timeseries returns tags and fields for use in influxdb
type SensorEventReader ¶
type SensorEventReader struct {
// contains filtered or unexported fields
}
SensorEventReader reads events from an event.reader and returns SensorEvents
func (*SensorEventReader) Start ¶
func (r *SensorEventReader) Start(out chan *SensorEvent) error
starts a thread reading events into the given channel returns immediately
func (*SensorEventReader) StopReadEvents ¶
func (r *SensorEventReader) StopReadEvents()
Close closes the reader, closing the connection to deconz and terminating the goroutine
type SensorGetter ¶
SensorGetter defines how we like to ask for sensors
type SensorLookup ¶
SensorLookup represents an interface for sensor lookup