Loadpoint: update climater when streaming (#25246)
This commit is contained in:
parent
a72f0c3c5f
commit
3422cf0b7e
2 changed files with 5 additions and 8 deletions
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue