Documentation ¶
Overview ¶
Package heliospectra discovers and controls Heliospectra LX/RX LED Grow Lights.
Discovery is done on the local network over UDP, and control of light intensities is performed via plain HTTP (also on the local network).
Index ¶
Constants ¶
const ( // TCPPort is the TCP Port that Heliospectra LED fixtures listen on. TCPPort = 50630 // UDPPort is the UDP Port that Heliospectra LED fixtures listen on. UDPPort = 50632 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is a Heliospectra LED device.
func NewDevice ¶
NewDevice creates a new device from an IP address. If client is nil, the http.DefaultClient is used.
func (*Device) Diagnostic ¶
func (d *Device) Diagnostic(ctx context.Context) (*Diagnostic, error)
Diagnostic executes a diagnostic request against the Device.
func (*Device) SetIntensities ¶
SetIntensities sets the intensities for each wavelength of this Device. You must provide the same number of intensities as the number of distinct wavelengths this Device has.
type DeviceInfo ¶
type DeviceInfo struct { MAC string `xml:"MACAddress"` DHCP bool IPAddr net.IP `xml:"IPAddress"` NetMask string Gateway net.IP DNS1 net.IP DNS2 net.IP FwVersion string SerialNum string `xml:"SerialNr"` }
DeviceInfo is the information about a device returned during a scan.
type Diagnostic ¶
type Diagnostic struct { Model string `xml:"model"` CPUFW string `xml:"cpuFW"` DriverFW string `xml:"driverFW"` EthernetMAC string `xml:"ethernetMAC"` WlanMAC string `xml:"wlanMAC"` Wavelengths WavelengthList `xml:"wavelengths"` Clock string `xml:"clock"` OnSchedule string `xml:"onSchedule"` MasterOrSlave string `xml:"masterOrSlave"` SystemStatus string `xml:"systemStatus"` Runtime string `xml:"runtime"` LatestChange string `xml:"latestChange"` ChangedBy string `xml:"changedBy"` ChangeIP string `xml:"changeIP"` ChangeType string `xml:"changeType"` Temps string `xml:"temps"` Intensities string `xml:"intensities"` UseNTP uint `xml:"useNTP"` NetworkType string `xml:"networkType"` NetworkIP net.IP `xml:"networkIP"` NetworkSubnet net.IP `xml:"networkSubnet"` NetworkGateway net.IP `xml:"networkGateway"` NetworkDNS1 net.IP `xml:"networkDNS1"` NetworkDNS2 net.IP `xml:"networkDNS2"` AllowedTemp string `xml:"allowedTemp"` Hs string `xml:"hs"` Title string `xml:"title"` WLANIP net.IP `xml:"wlanIP"` EthernetIP net.IP `xml:"ethernetIP"` NTPOffset string `xml:"ntpOffset"` Masters string `xml:"masters"` Dialog string `xml:"dialog"` PoweredLink string `xml:"poweredLink"` PoweredText string `xml:"poweredText"` NTPPoolType string `xml:"ntpPoolType"` NTPPoolCustom string `xml:"ntpPoolCustom"` Favicon string `xml:"favicon"` TempUnit string `xml:"tempUnit"` LockData string `xml:"lockData"` Shortcuts string `xml:"shortcuts"` NTPData string `xml:"ntpData"` MulticastIP string `xml:"multicastIP"` Tags string `xml:"tags"` }
Diagnostic is the result of a diagnostic request against a Device.
type Status ¶
type Status struct { InternalTime string `xml:"a"` OnSchedule string `xml:"b"` Status string `xml:"c"` Uptime string `xml:"d"` LastChangeAt string `xml:"e"` LastChangeInterface string `xml:"f"` LastChangeBy net.IP `xml:"g"` LastChangeType string `xml:"h"` Temp string `xml:"i"` Intensities string `xml:"j"` Masters string `xml:"k"` Reserved string `xml:"l"` ControlMode string `xml:"m"` NTPTimeSettings string `xml:"q"` }
Status is the response to a status.xml call.
type WavelengthDescription ¶
WavelengthDescription is a description of an available wavelength on a Device.
type WavelengthList ¶
type WavelengthList []WavelengthDescription
WavelengthList is a list of WavelengthDescriptions.
func (*WavelengthList) UnmarshalXML ¶
func (wl *WavelengthList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML unmarshals a list of WavelengthDescriptions from XML.