Skip to content

Commit

Permalink
Add more attributes to Telemetry model
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-ioki committed Nov 4, 2024
1 parent a3e2b88 commit f745316
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 4 deletions.
154 changes: 151 additions & 3 deletions lib/ioki/model/operator/telemetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,171 @@ class Telemetry < Base
on: :read,
type: :string

attribute :battery_level,
attribute :altitude,
on: :read,
type: :float

attribute :remaining_distance,
attribute :altitude_source,
on: :read,
type: :string

attribute :altitude_synced_at,
on: :read,
type: :date_time

attribute :battery_level,
on: :read,
type: :float

attribute :battery_level_source,
on: :read,
type: :string

attribute :battery_level_synced_at,
on: :read,
type: :date_time

attribute :charging_state,
on: :read,
type: :string

attribute :charging_state_source,
on: :read,
type: :string

attribute :charging_state_synced_at,
on: :read,
type: :date_time

attribute :door_state,
on: :read,
type: :string

attribute :door_state_source,
on: :read,
type: :string

attribute :door_state_synced_at,
on: :read,
type: :date_time

attribute :estimated_time_until_full_recharge,
on: :read,
type: :float

attribute :last_synced_at,
attribute :estimated_time_until_full_recharge_source,
on: :read,
type: :string

attribute :estimated_time_until_full_recharge_synced_at,
on: :read,
type: :date_time

attribute :heading,
on: :read,
type: :float

attribute :heading_source,
on: :read,
type: :string

attribute :heading_synced_at,
on: :read,
type: :date_time

attribute :lat,
on: :read,
type: :float

attribute :lat_source,
on: :read,
type: :string

attribute :lat_synced_at,
on: :read,
type: :date_time

attribute :lng,
on: :read,
type: :float

attribute :lng_source,
on: :read,
type: :string

attribute :lng_synced_at,
on: :read,
type: :date_time

attribute :mobileye_mission_state,
on: :read,
type: :string

attribute :mobileye_mission_state_source,
on: :read,
type: :string

attribute :mobileye_mission_state_synced_at,
on: :read,
type: :date_time

attribute :mobileye_sds_state,
on: :read,
type: :string

attribute :mobileye_sds_state_source,
on: :read,
type: :string

attribute :mobileye_sds_state_synced_at,
on: :read,
type: :date_time

attribute :people_count,
on: :read,
type: :integer

attribute :people_count_source,
on: :read,
type: :string

attribute :people_count_synced_at,
on: :read,
type: :date_time

attribute :remaining_distance,
on: :read,
type: :float

attribute :remaining_distance_source,
on: :read,
type: :string

attribute :remaining_distance_synced_at,
on: :read,
type: :date_time

attribute :speed,
on: :read,
type: :float

attribute :speed_source,
on: :read,
type: :string

attribute :speed_synced_at,
on: :read,
type: :date_time

attribute :tires_pressure,
on: :read,
type: :array

attribute :tires_pressure_source,
on: :read,
type: :string

attribute :tires_pressure_synced_at,
on: :read,
type: :date_time
end
Expand Down
1 change: 0 additions & 1 deletion spec/ioki/model/operator/telemetry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
it { is_expected.to define_attribute(:remaining_distance).as(:float) }
it { is_expected.to define_attribute(:charging_state).as(:string) }
it { is_expected.to define_attribute(:estimated_time_until_full_recharge).as(:float) }
it { is_expected.to define_attribute(:last_synced_at).as(:date_time) }
end

0 comments on commit f745316

Please sign in to comment.