| 156 | } |
| 157 | |
| 158 | func (lp *Loadpoint) resetHeatingSession() { |
| 159 | if lp.session == nil || !lp.chargerHasFeature(api.Heating) || !lp.chargerHasFeature(api.IntegratedDevice) { |
| 160 | return |
| 161 | } |
| 162 | |
| 163 | if !now.With(lp.clock.Now()).BeginningOfDay().After(lp.session.Created) { |
| 164 | return |
| 165 | } |
| 166 | |
| 167 | lp.stopSession() |
| 168 | lp.clearSession() |
| 169 | |
| 170 | if cr, ok := lp.chargeRater.(wrapper.ChargeResetter); ok { |
| 171 | cr.ResetCharge() |
| 172 | } |
| 173 | if ct, ok := lp.chargeTimer.(wrapper.ChargeResetter); ok { |
| 174 | ct.ResetCharge() |
| 175 | } |
| 176 | |
| 177 | lp.createSession() |
| 178 | } |