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

Operator Api | Add VehicleTelemetry model #377

Merged
merged 2 commits into from May 7, 2024

Conversation

tom-ioki
Copy link
Contributor

@tom-ioki tom-ioki commented May 7, 2024

This adds the VehicleTelemetry model for the operator api.

@tom-ioki tom-ioki requested a review from phylor May 7, 2024 07:56
@tom-ioki tom-ioki self-assigned this May 7, 2024
@@ -126,6 +126,11 @@ class Vehicle < Base
omit_if_nil_on: [:create, :update],
type: :integer

attribute :vehicle_telemetry,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this called telemetry? This is what I currently get back:

                "telemetry": {
                    "battery_level": null,
                    "charging_state": null,
                    "estimated_time_until_full_recharge": null,
                    "id": null,
                    "last_synced_at": null,
                    "remaining_distance": null,
                    "type": "fleet_state/vehicle_telemetry"
                },
                "type": "fleet_state/vehicle"

I guess it's fine at the moment to use the Vehicle model. If the fleet state vehicle digresses further, it might be good to create a new model. But let's see how this evolves 🙂

Copy link
Collaborator

@phylor phylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't able to test as I couldn't find any test data 🙂 Looks fine though!

@tom-ioki tom-ioki merged commit c594689 into main May 7, 2024
2 checks passed
@tom-ioki tom-ioki deleted the add-vehicle-telemetry-to-fleet-state branch May 7, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants