package driver import ( "time" "onehouse/protocol" ) // Command is one validated device request. A driver checks ownership, access, // and Expired immediately before physical work. Each batch member keeps its own // metadata, expiry, and payload. The queue consumer owns these values. type Command struct { DeviceID string Capability string Metadata protocol.Metadata Payload protocol.ValuePayload } // Expired reports whether the command has no expiry or has reached it. func (c Command) Expired(now time.Time) bool { return c.Metadata.ExpiresAt == nil || !now.Before(*c.Metadata.ExpiresAt) }