Skip to content

Commit

Permalink
BMW: add climater (#18114)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfuchs1984 authored Jan 7, 2025
1 parent 65bdb40 commit 54b6b91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vehicle/bmw/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ func (v *Provider) GetLimitSoc() (int64, error) {
return res.State.ElectricChargingState.ChargingTarget, nil
}

var _ api.VehicleClimater = (*Provider)(nil)

// Climater implements the api.VehicleClimater interface
func (v *Provider) Climater() (bool, error) {
res, err := v.statusG()
return res.State.ClimateControlState.Activity == "HEATING" || res.State.ClimateControlState.Activity == "COOLING", err
}

var _ api.Resurrector = (*Provider)(nil)

func (v *Provider) WakeUp() error {
Expand Down
3 changes: 3 additions & 0 deletions vehicle/bmw/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ type VehicleStatus struct {
ChargingStatus string
ChargingTarget int64
}
ClimateControlState struct {
Activity string
}
}
}

0 comments on commit 54b6b91

Please sign in to comment.