Disable remote control without configured vehicle (#745)

This commit is contained in:
andig 2021-03-11 13:28:34 +01:00 • committed by GitHub
parent 8b79438284
commit 46a28992e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,9 +366,14 @@ func (s *SEMP) deviceStatus(id int, lp core.LoadPointAPI) DeviceStatus {
}
}
var hasVehicle bool
if hasVehicleP, err := s.cache.GetChecked(id, "hasVehicle"); err == nil {
hasVehicle = hasVehicleP.Val.(bool)
}
res := DeviceStatus{
DeviceID: s.deviceID(id),
EMSignalsAccepted: s.controllable && isPV,
EMSignalsAccepted: s.controllable && isPV && hasVehicle,
PowerInfo: PowerInfo{
AveragePower: int(chargePower),
AveragingInterval: 60,
@ -433,7 +438,7 @@ func (s *SEMP) planningRequest(id int, lp core.LoadPointAPI) (res PlanningReques
if mode == api.ModeNow {
minPowerConsumption = maxPowerConsumption
}
if connected && maxEnergy > 0 {
res = PlanningRequest{
Timeframe: []Timeframe{{