mirror of
https://github.com/nikdoof/hapz2m.git
synced 2026-01-30 02:18:22 +00:00
Added quiet mode for reduced verbosity
This is useful to reduce clutter if you're running the service and it's writing logs to the main syslog.
This commit is contained in:
@@ -56,6 +56,7 @@ type Bridge struct {
|
||||
Interfaces []string
|
||||
|
||||
DebugMode bool
|
||||
QuietMode bool
|
||||
|
||||
ctx context.Context
|
||||
bridgeAcc *accessory.Bridge
|
||||
@@ -561,7 +562,7 @@ func (br *Bridge) UpdateAccessoryState(devName string, payload []byte) {
|
||||
return
|
||||
}
|
||||
|
||||
if br.DebugMode || time.Since(dev.LastSeen) > 30*time.Second {
|
||||
if br.DebugMode || (!br.QuietMode && time.Since(dev.LastSeen) > 30*time.Second) {
|
||||
log.Printf("received update for device %q", devName)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user