Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer_typed changes the values of strings #256

Open
Bre77 opened this issue Dec 5, 2024 · 1 comment
Open

prefer_typed changes the values of strings #256

Bre77 opened this issue Dec 5, 2024 · 1 comment

Comments

@Bre77
Copy link

Bre77 commented Dec 5, 2024

Getting typed values from Fleet Telemetry with prefer_typed is great, but I wanted to check that it was meant to be changing the string values to different string values too.

For example
Sentry Mode has changed:
Off is SentryModeStateOff
Idle is SentryModeStateIdle
Armed is SentryModeStateArmed
etc

These already had pretty good values
, but now the protobuf field names are being returned

@Bre77 Bre77 changed the title prefered_typed changes the values of strings prefer_typed changes the values of strings Dec 5, 2024
@jbanyer
Copy link

jbanyer commented Jan 12, 2025

In addition: not all enum fields are being handled consistently, eg with the JSON format, vehicle version 2024.44.25.4 ad52e3119f65:

With prefer_typed = false:

      {
         "key":"ChargePortLatch",
         "value":{
            "stringValue":"Engaged"
         }
      },
      {
         "key":"DetailedChargeState",
         "value":{
            "detailedChargeStateValue":"DetailedChargeStateCharging"
         }
      },

With prefer_typed = true:

      {
         "key":"ChargePortLatch",
         "value":{
            "chargePortLatchValue":"ChargePortLatchEngaged"
         }
      },
      {
         "key":"DetailedChargeState",
         "value":{
            "detailedChargeStateValue":"DetailedChargeStateCharging"
         }
      },

Notice that DetailedChargeState is handled the same way regardless of prefer_typed, whereas ChargePortLatch is represented differently based on prefer_typed.

Is this going to change with future software releases? What is the recommended approach to handling enum values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants