Loadpoint: update climater when streaming (#25246)

This commit is contained in:
andig 2025-11-12 13:37:14 +01:00 • committed by GitHub
parent a72f0c3c5f
commit 3422cf0b7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 8 deletions

View file

@ -1746,7 +1746,7 @@ func (lp *Loadpoint) publishSocAndRange() {
}
// integrated device can bypass the update interval if vehicle is separately configured (legacy)
if lp.chargerHasFeature(api.IntegratedDevice) || lp.vehicleHasFeature(api.Streaming) || lp.vehicleSocPollAllowed() {
if lp.chargerHasFeature(api.IntegratedDevice) || lp.vehicleSocPollAllowed() {
lp.socUpdated = lp.clock.Now()
f, err := socEstimator.Soc(lp.GetChargedEnergy())

View file

@ -319,20 +319,17 @@ func (lp *Loadpoint) vehicleOdometer() {
// vehicleClimatePollAllowed determines if polling depending on mode and connection status
func (lp *Loadpoint) vehicleClimatePollAllowed() bool {
switch {
case lp.Soc.Poll.Mode == loadpoint.PollCharging && lp.charging():
if lp.charging() || lp.vehicleHasFeature(api.Streaming) {
return true
case (lp.Soc.Poll.Mode == loadpoint.PollConnected || lp.Soc.Poll.Mode == loadpoint.PollAlways) && lp.connected():
return true
default:
return false
}
return (lp.Soc.Poll.Mode == loadpoint.PollConnected || lp.Soc.Poll.Mode == loadpoint.PollAlways) && lp.connected()
}
// vehicleSocPollAllowed validates charging state against polling mode
func (lp *Loadpoint) vehicleSocPollAllowed() bool {
// always update soc when charging
if lp.charging() {
if lp.charging() || lp.vehicleHasFeature(api.Streaming) {
return true
}