Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
e2c464b34e | |||
8a4f360a45 |
@ -145,6 +145,8 @@ func UnmarshalQueryParams(query url.Values) (*AmbientWeatherUpdate, error) {
|
||||
update := new(AmbientWeatherUpdate)
|
||||
|
||||
decoder := schema.NewDecoder()
|
||||
decoder.IgnoreUnknownKeys(true)
|
||||
|
||||
if err := decoder.Decode(update, query); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -29,6 +29,12 @@ type AmbientWeatherUpdate struct {
|
||||
BattIn *int `json:"battin,omitempty" schema:"battin"`
|
||||
BattCO2 *int `json:"batt_co2,omitempty" schema:"batt_co2"`
|
||||
*AmbientTempHumiditySensors
|
||||
*AmbientLightningData
|
||||
}
|
||||
|
||||
type AmbientLightningData struct {
|
||||
BattLightning *int `json:"batt_lightning,omitempty" schema:"batt_lightning"`
|
||||
LightningDay *int `json:"lightning_day,omitempty" schema:"lightning_day"`
|
||||
}
|
||||
|
||||
type AmbientTempHumiditySensors struct {
|
||||
|
Reference in New Issue
Block a user