Documentation ¶
Index ¶
Constants ¶
const DeconzDiscoveryEndpoint = "https://dresden-light.appspot.com/discover"
DeconzDiscoveryEndpoint is the URL used when auto discovering a deCONZ gateway
const YmlFileName = "deflux.yml"
YmlFileName is the name of the default config file
Variables ¶
This section is empty.
Functions ¶
func OutputDefaultConfiguration ¶
func OutputDefaultConfiguration()
OutputDefaultConfiguration tries to pair with deCONZ and prints the default config to stdout
Types ¶
type APIConfig ¶
APIConfig holds properties of the deCONZ API
func (*APIConfig) DiscoverWebsocket ¶
DiscoverWebsocket tries to retrieve the websocket address from the deCONZ REST API using the /config endpoint
type Configuration ¶
type Configuration struct { Deconz APIConfig InfluxDB InfluxDB FillValues FillConfig }
Configuration holds data for Deconz and InfluxDB configuration
func LoadConfiguration ¶
func LoadConfiguration(file string) (*Configuration, error)
LoadConfiguration loads the deflux configuration from a file. The file parameter provides a location. If it is empty, deflux tries the default config file locations ./deflux.yml and /etc/deflux.yml
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 FillConfig ¶
type FillConfig struct { // Enabled is set true if sensor values shall be added from the REST API, if no updates have been received // for some time over the websocket. Enabled bool // InitialFill set true will write the most recent measurement for each sensor from the REST API on startup InitialFill bool // FillInterval defines the duration after which the last sensor value from the REST API is inserted into the // database, if no more events have been seen from the websocket FillInterval time.Duration // LastSeenTimeout defines the duration after which a sensor is considered offline // It compares the wallclock time to the "lastseen" field of the /sensors REST endpoint LastSeenTimeout time.Duration }
FillConfig holds configuration for polling sensor measurements from the REST API