From c181a2f9a20d450ec7ff8e762faa732186a0ac7f Mon Sep 17 00:00:00 2001 From: Andrei Sokolov Date: Sun, 23 Nov 2025 12:41:50 +0100 Subject: [PATCH] clean up --- .../own_tracks/family_locations_formatter.rb | 1 - app/services/own_tracks/params.rb | 23 ++----------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/app/services/own_tracks/family_locations_formatter.rb b/app/services/own_tracks/family_locations_formatter.rb index 203bfa03..f25aa955 100644 --- a/app/services/own_tracks/family_locations_formatter.rb +++ b/app/services/own_tracks/family_locations_formatter.rb @@ -41,7 +41,6 @@ class OwnTracks::FamilyLocationsFormatter alt: point.altitude, batt: point.battery, bs: OwnTracks::Params.battery_status_to_numeric(point.battery_status), - # t: OwnTracks::Params.trigger_to_string(point.trigger), vel: OwnTracks::Params.velocity_to_kmh(point.velocity), conn: OwnTracks::Params.connection_to_string(point.connection), } diff --git a/app/services/own_tracks/params.rb b/app/services/own_tracks/params.rb index 0306f455..7f5c2d1f 100644 --- a/app/services/own_tracks/params.rb +++ b/app/services/own_tracks/params.rb @@ -103,19 +103,6 @@ class OwnTracks::Params end end - def trigger_to_string(trigger) - case trigger - when 'background_event' then 'p' - when 'circular_region_event' then 'c' - when 'beacon_event' then 'b' - when 'report_location_message_event' then 'r' - when 'manual_event' then 'u' - when 'timer_based_event' then 't' - when 'settings_monitoring_event' then 'v' - else nil - end - end - def connection_to_string(connection) case connection when 'mobile' then 'm' @@ -132,14 +119,8 @@ class OwnTracks::Params velocity_float = velocity.to_f return nil if velocity_float.zero? - # Velocity should be in km/h for Owntracks format (integer) - # If stored as m/s (typically < 50), convert to km/h - # Otherwise assume it's already in km/h - if velocity_float < 50 - (velocity_float * 3.6).round.to_i - else - velocity_float.round.to_i - end + # Reference: https://owntracks.org/booklet/tech/json/ + (velocity_float * 3.6).round.to_i end end end