EEBus: treat unavailable measurement data as not available (#30874)

This commit is contained in:
andig 2026-06-15 09:55:30 +02:00 • committed by GitHub
parent 10e3f0dcf9
commit 33d9c3bddb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -154,8 +154,10 @@ func eebusReadValue[T any](uc eebusapi.UseCaseBaseInterface, entity spineapi.Ent
res, err := update(entity)
if err != nil {
// announced but not provided
if errors.Is(err, eebusapi.ErrDataNotAvailable) {
// scenario announced but no usable value yet
if errors.Is(err, eebusapi.ErrDataNotAvailable) ||
errors.Is(err, eebusapi.ErrMetadataNotAvailable) ||
errors.Is(err, eebusapi.ErrDataInvalid) {
err = api.ErrNotAvailable
}
return zero, err
@ -188,10 +190,6 @@ func (c *EEBus) readPhases(scenario uint, update func(entity spineapi.EntityRemo
res, err := eebusReadValue(c.mm, c.maEntity, scenario, update)
if err != nil {
// announced but not provided
if errors.Is(err, eebusapi.ErrDataNotAvailable) {
err = api.ErrNotAvailable
}
return 0, 0, 0, err
}