Skip to content

Commit

Permalink
Porsche: handle privacy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Apr 13, 2023
1 parent 7c0b6ac commit 6098cc5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vehicle/porsche/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ func (s *StatusResponseMobile) MeasurementByKey(key string) (*MeasurementMobile,
if m.Key == key {
var err error
if !m.Status.IsEnabled {
if m.Status.Cause != "UNKNOWN" {
switch m.Status.Cause {
case "UNKNOWN":
break
case "PRIVACY_ACTIVATED":
err = api.ErrNotAvailable
default:
err = errors.New(m.Status.Cause)
}
}
Expand Down

0 comments on commit 6098cc5

Please sign in to comment.