mirror of
https://github.com/nikdoof/hapz2m.git
synced 2026-01-30 11:38:22 +00:00
Added more debugging output and microsecond log timestamps
This commit is contained in:
@@ -189,6 +189,9 @@ func (br *Bridge) StartHAP() error {
|
|||||||
|
|
||||||
if br.DebugMode {
|
if br.DebugMode {
|
||||||
haplog.Debug.Enable()
|
haplog.Debug.Enable()
|
||||||
|
|
||||||
|
// add microseconds to log output
|
||||||
|
log.SetFlags(log.LstdFlags | log.Lmicroseconds)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = br.server.ListenAndServe(br.ctx)
|
err = br.server.ListenAndServe(br.ctx)
|
||||||
@@ -579,11 +582,17 @@ wait:
|
|||||||
// updatedVal is float64 coz that's how Z2M JSON values are, but expVal may not be
|
// updatedVal is float64 coz that's how Z2M JSON values are, but expVal may not be
|
||||||
mapping.ExposesEntry.Type == "numeric" && cmpFloat64Numeric(updatedVal, expVal) {
|
mapping.ExposesEntry.Type == "numeric" && cmpFloat64Numeric(updatedVal, expVal) {
|
||||||
|
|
||||||
|
if br.DebugMode {
|
||||||
|
log.Printf("Z2M state %q for %s updated to %q", prop, key, updatedVal)
|
||||||
|
}
|
||||||
updated = true
|
updated = true
|
||||||
break wait
|
break wait
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
if br.DebugMode {
|
||||||
|
log.Printf("Z2M state update %s timed out", key)
|
||||||
|
}
|
||||||
break wait
|
break wait
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user