chore: fix race condition

This commit is contained in:
andig 2024-08-09 16:07:00 +02:00
parent 80b2c79e0d
commit ee2284a6ae

View file

@ -557,6 +557,9 @@ var _ api.CurrentGetter = (*EEBus)(nil)
// GetMaxCurrent implements the api.CurrentGetter interface
func (c *EEBus) GetMaxCurrent() (float64, error) {
c.mux.RLock()
defer c.mux.RUnlock()
if c.currentLimit == -1 {
return 0, api.ErrNotAvailable
}