EEBus: abort run loop and limit assertion on context cancellation (#32494)

This commit is contained in:
andig 2026-08-03 20:50:34 +02:00 • committed by GitHub
parent 4a878838e7
commit fed3fb731c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 54 additions and 12 deletions

View file

@ -189,7 +189,7 @@ func (c *EEBusOHPCF) UseCaseEvent(_ spineapi.DeviceRemoteInterface, entity spine
c.egLpcEntity = entity
// [LPC-913]: state the limit to the newly available CS
go eebus.AssertLimit(c.log, func() error { return c.Dim(c.lastDimmed()) })
go eebus.AssertLimit(c.ctx, c.log, func() error { return c.Dim(c.lastDimmed()) })
}
c.mu.Unlock()
}

View file

@ -29,6 +29,7 @@ func newOHPCFEGCharger(t *testing.T) (*EEBusOHPCF, *egmocks.EgLPCInterface, spin
entity := spinemocks.NewEntityRemoteInterface(t)
c := &EEBusOHPCF{
ctx: t.Context(),
log: util.NewLogger("eebus-ohpcf-test"),
eg: &eebus.EnergyGuard{EgLPCInterface: lpc},
egLpcEntity: entity,