add state as second arg for eventListenerCallback

This commit is contained in:
Sam Lewis
2022-11-08 22:48:34 -05:00
parent 5afa301f36
commit 1ec5878ff9
4 changed files with 14 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ func pantryLights(service *ga.Service, state *ga.State, sensor ga.EntityData) {
}
}
func onEvent(service *ga.Service, data ga.EventData) {
func onEvent(service *ga.Service, state *ga.State, data ga.EventData) {
// Since the structure of the event changes depending
// on the event type, you can Unmarshal the raw json
// into a Go type. If a type for your event doesn't