EEbus: only disable recommendations if available (#15829)

Some EEBUS wallboxes like the PCMP do report the OSCEV usecase to be available, but it doesn’t provide the necessary recommendation limit data.

This change adds checks for this case.
This commit is contained in:
Andreas Linde 2024-09-01 20:00:11 +02:00 • committed by GitHub
parent 6a3aeb2212
commit 095fa42be9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,8 +343,13 @@ func (c *EEBus) writeCurrentLimitData(evEntity spineapi.EntityRemoteInterface, c
}
// make sure the recommendations are inactive, otherwise the EV won't go to sleep
if err := c.disableLimits(evEntity, c.uc.OscEV); err != nil {
return err
// but only if it supports OSCEV and has required data!
if c.uc.OscEV.IsScenarioAvailableAtEntity(evEntity, 1) {
if _, err := c.uc.OscEV.LoadControlLimits(evEntity); err == nil {
if err := c.disableLimits(evEntity, c.uc.OscEV); err != nil {
return err
}
}
}
// set overload protection limits
@ -419,6 +424,11 @@ func (c *EEBus) writeLoadControlLimitsVASVW(evEntity spineapi.EntityRemoteInterf
return false
}
// OSCEV requires recommendation limits to be available
if _, err := c.uc.OscEV.LoadControlLimits(evEntity); err != nil {
return false
}
// on OSCEV all limits have to be active except they are set to the default value
minLimits, _, _, err := c.uc.OscEV.CurrentLimits(evEntity)
if err != nil {