Only pass State struct pointer to StateOpen, not entire response

This commit is contained in:
Bendodroid 2024-01-14 01:53:36 +01:00
commit 70b2e8069b
Signed by: bendodroid
GPG key ID: 3EEE19A0F73D5FFC
3 changed files with 10 additions and 8 deletions

View file

@ -37,7 +37,7 @@ func main() {
handlers.Root(&conf.Response),
)
http.HandleFunc("/state/open",
handlers.StateOpen(conf.Credentials, conf.Dynamic.State.Open.AllowedCredentials, &conf.Response),
handlers.StateOpen(conf.Credentials, conf.Dynamic.State.Open.AllowedCredentials, &conf.Response.State),
)
// Register handlers for Environmental Sensors
for key, envSensorConfigs := range conf.Dynamic.Sensors {