maybePushVehicleConnect sends a deferred connect notification once vehicle detection has settled
()
| 476 | // maybePushVehicleConnect sends a deferred connect notification once vehicle |
| 477 | // detection has settled |
| 478 | func (lp *Loadpoint) maybePushVehicleConnect() { |
| 479 | if !lp.connectPending { |
| 480 | return |
| 481 | } |
| 482 | |
| 483 | // hold while detection is still running and the vehicle is unidentified |
| 484 | if lp.GetVehicle() == nil && !lp.vehicleDetect.IsZero() { |
| 485 | return |
| 486 | } |
| 487 | |
| 488 | lp.connectPending = false |
| 489 | lp.pushEvent(evVehicleConnect) |
| 490 | } |
| 491 | |
| 492 | // publish sends values to UI and databases |
| 493 | func (lp *Loadpoint) publish(key string, val any) { |
no test coverage detected