Documentation
¶
Index ¶
- Variables
- func GET(url string) ([]byte, error)
- func PUT[T any](url string, payload T) ([]byte, error)
- func SendRequest(url string, method string, payload *[]byte) ([]byte, error)
- type ActiveAlarms
- type AlarmEnvironment
- type DeviceDetails
- type DeviceDetailsDevice
- type DeviceDetailsSpecVersion
- type DuskSettings
- type LightStatus
- type LightThemes
- type SensorData
- type Somneo
- func (somneo *Somneo) GetActiveAlarms() (ActiveAlarms, error)
- func (somneo *Somneo) GetAlarmEnvironment() (AlarmEnvironment, error)
- func (somneo *Somneo) GetDeviceDetails() (DeviceDetails, error)
- func (somneo *Somneo) GetDuskLightThemes() (LightThemes, error)
- func (somneo *Somneo) GetDuskSettings() (DuskSettings, error)
- func (somneo *Somneo) GetLightStatus() (LightStatus, error)
- func (somneo *Somneo) GetLightThemes() (LightThemes, error)
- func (somneo *Somneo) GetSensorData() (SensorData, error)
- func (somneo *Somneo) GetWakeupAlarmStatus() (WakeupAlarmStatus, error)
- func (somneo *Somneo) GetWakeupPlay() (WakeupPlay, error)
- func (somneo *Somneo) GetWakeupStatus() (WakeUpStatus, error)
- func (somneo *Somneo) GetWakeupTones() (WakeupTones, error)
- func (somneo *Somneo) GetWindDownDusk() (WindDownDusk, error)
- func (somneo *Somneo) SetMainLightLevel(percent float64) error
- func (somneo *Somneo) TurnMainLightOff() error
- func (somneo *Somneo) TurnMainLightOn() error
- func (somneo *Somneo) TurnNightlightOff() error
- func (somneo *Somneo) TurnNightlightOn() error
- func (somneo *Somneo) TurnOffAllLights() error
- type Tone
- type WakeUpStatus
- type WakeupAlarmStatus
- type WakeupPlay
- type WakeupTones
- type WindDownDusk
Constants ¶
This section is empty.
Variables ¶
View Source
var ActiveAlarmsEndpoint string = "/di/v1/products/1/wualm/aalms"
View Source
var AlarmEnvironmentEndpoint string = "/di/v1/products/1/wualm/aenvs"
View Source
var DeviceDetailsEndpoint string = "/upnp/description.xml"
View Source
var DuskLightThemesEndpoint string = "/di/v1/products/1/files/dusklightthemes"
View Source
var DuskSettingsEndpoint string = "`/di/v1/products/1/wudsk"
View Source
var LightEndpoint string = "/di/v1/products/1/wulgt" // GET || PUT
View Source
var LightThemesEndpoint string = "/di/v1/products/1/files/lightthemes"
View Source
var SensorDataEnpoint string = "/di/v1/products/1/wusrd"
View Source
var WakeUpAlarmStatusEndpoint string = "/di/v1/products/1/wualm"
View Source
var WakeUpStatusEndpoint string = "/di/v1/products/1/wusts"
View Source
var WakeupPlayEndpoint string = "/di/v1/products/1/wuply"
View Source
var WakeupTonesEndpoint string = "/di/v1/products/1/files/wakeup"
View Source
var WindDownDuskEndpoint string = "/di/v1/products/1/files/winddowndusk"
Functions ¶
Types ¶
type ActiveAlarms ¶
type ActiveAlarms struct { Year [16]int `json:"ayear"` // Year of the alarm Month [16]int `json:"amnth"` // Month (0-11) Day [16]int `json:"alday"` // Day of the month DayBitMask [16]int `json:"daynm"` // Weekdays as bitmask (e.g., 254 = Mon-Sun) Hour [16]int `json:"almhr"` // Hour (0-23) Minute [16]int `json:"almmn"` // Minute (0-59) }
Active alarms
type AlarmEnvironment ¶
type AlarmEnvironment struct { ProfilesEnabled [16]bool `json:"prfen"` ProfileValues [16]bool `json:"prfvs"` PowerSave [48]int `json:"pwrsv"` }
Alarm environment settings
type DeviceDetails ¶
type DeviceDetails struct { SpecVersion DeviceDetailsSpecVersion `xml:"specVersion"` Device DeviceDetailsDevice `xml:"device"` }
Device details (XML representation)
type DeviceDetailsDevice ¶
type DuskSettings ¶
type DuskSettings struct { IsOn bool `json:"onoff"` CurveType int `json:"curve"` Duration int `json:"durat"` ControlType int `json:"ctype"` SoundType int `json:"sndtp"` SoundDevice string `json:"snddv"` SoundChannel string `json:"sndch"` SoundLevel int `json:"sndlv"` SoundStatus int `json:"sndss"` }
type LightStatus ¶
type SensorData ¶
type SensorData struct { // Current values MeasuredLux float64 `json:"mslux"` // Brightness in Lux MeasuredTemp float64 `json:"mstmp"` // Temperature in °C MeasuredHumidity float64 `json:"msrhu"` // Humidity in % MeasuredSound int `json:"mssnd"` // Sound level // Average values AverageLux float64 `json:"avlux"` // Average brightness AverageTemp float64 `json:"avtmp"` // Average temperature AverageHumidity float64 `json:"avhum"` // Average humidity AverageSound int `json:"avsnd"` // Average sound level EnergyScore int `json:"enscr"` // Energy score }
type Somneo ¶
type Somneo struct { Host string LightStatus *LightStatus SensorData *SensorData }
func (*Somneo) GetActiveAlarms ¶
func (somneo *Somneo) GetActiveAlarms() (ActiveAlarms, error)
func (*Somneo) GetAlarmEnvironment ¶
func (somneo *Somneo) GetAlarmEnvironment() (AlarmEnvironment, error)
func (*Somneo) GetDeviceDetails ¶
func (somneo *Somneo) GetDeviceDetails() (DeviceDetails, error)
func (*Somneo) GetDuskLightThemes ¶
func (somneo *Somneo) GetDuskLightThemes() (LightThemes, error)
func (*Somneo) GetDuskSettings ¶
func (somneo *Somneo) GetDuskSettings() (DuskSettings, error)
func (*Somneo) GetLightStatus ¶
func (somneo *Somneo) GetLightStatus() (LightStatus, error)
func (*Somneo) GetLightThemes ¶
func (somneo *Somneo) GetLightThemes() (LightThemes, error)
func (*Somneo) GetSensorData ¶
func (somneo *Somneo) GetSensorData() (SensorData, error)
func (*Somneo) GetWakeupAlarmStatus ¶
func (somneo *Somneo) GetWakeupAlarmStatus() (WakeupAlarmStatus, error)
func (*Somneo) GetWakeupPlay ¶
func (somneo *Somneo) GetWakeupPlay() (WakeupPlay, error)
func (*Somneo) GetWakeupStatus ¶
func (somneo *Somneo) GetWakeupStatus() (WakeUpStatus, error)
func (*Somneo) GetWakeupTones ¶
func (somneo *Somneo) GetWakeupTones() (WakeupTones, error)
func (*Somneo) GetWindDownDusk ¶
func (somneo *Somneo) GetWindDownDusk() (WindDownDusk, error)
func (*Somneo) SetMainLightLevel ¶
func (*Somneo) TurnMainLightOff ¶
func (*Somneo) TurnNightlightOff ¶
func (*Somneo) TurnNightlightOn ¶
Control night light
func (*Somneo) TurnOffAllLights ¶
type WakeUpStatus ¶
type WakeUpStatus struct { WakeUpStatus int `json:"wusts"` ReadyToPair bool `json:"rpair"` PreviewMode bool `json:"prvmd"` StoreDemo bool `json:"sdemo"` PowerSave bool `json:"pwrsz"` CurrentValue int `json:"nrcur"` WizardStatus int `json:"wizrd"` Brightness int `json:"brght"` DisplayOn bool `json:"dspon"` WakeUpTime int `json:"wutim"` DurationTime int `json:"dutim"` CanUpdate bool `json:"canup"` SunsetTime int `json:"sntim"` }
type WakeupAlarmStatus ¶
type WakeupAlarmStatus struct { SnoozeTime int `json:"snztm"` AlarmEnvironment AlarmEnvironment `json:"aenvs"` ActiveAlarms ActiveAlarms `json:"aalms"` }
type WakeupPlay ¶
Click to show internal directories.
Click to hide internal directories.