Disable remote control without configured vehicle (#745)
This commit is contained in:
parent
8b79438284
commit
46a28992e6
1 changed files with 7 additions and 2 deletions
|
|
@ -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{{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue