From eb0e266c16ce57f648ff4d43cb256a4e71538364 Mon Sep 17 00:00:00 2001
From: Niklas Sombert
Date: Tue, 12 Mar 2024 17:54:20 +0100
Subject: [PATCH] efa: Show more departures
Also, don't display "min".
---
src/jobs/efa.rb | 8 +++++---
src/widgets/efa/efa.html | 11 ++++++++++-
src/widgets/efa/efa.scss | 1 +
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/jobs/efa.rb b/src/jobs/efa.rb
index 7b05cc3..d8a8133 100644
--- a/src/jobs/efa.rb
+++ b/src/jobs/efa.rb
@@ -2,14 +2,14 @@
require("net/http")
require("json")
-uri = URI('https://vrrf.finalrewind.org/D%C3%BCsseldorf/Kruppstr.json?no_lines=4')
+uri = URI('https://vrrf.finalrewind.org/D%C3%BCsseldorf/Kruppstr.json?no_lines=6')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.request_uri)
def json_to_data(data)
return {
- :time => data[2],
+ :time => data[2].gsub("sofort", "0 min").gsub("min", ""),
:line => data[0],
:dest => data[1].gsub("D-", "") # remove "D-"
}
@@ -33,9 +33,11 @@ def create_error_data(message)
:t2 => json_to_data(pre[1]),
:t3 => json_to_data(pre[2]),
:t4 => json_to_data(pre[3]),
+ :t5 => json_to_data(pre[4]),
+ :t6 => json_to_data(pre[5]),
:status => "normal"
}
- if data[:t4][:time] == ""
+ if data[:t6][:time] == ""
data[:status] = "warning"
end
send_event('efa', data)
diff --git a/src/widgets/efa/efa.html b/src/widgets/efa/efa.html
index f2d7375..d93b51b 100644
--- a/src/widgets/efa/efa.html
+++ b/src/widgets/efa/efa.html
@@ -20,7 +20,16 @@
-
+
+
+
+
+
+
+
+
+
+
diff --git a/src/widgets/efa/efa.scss b/src/widgets/efa/efa.scss
index 40d8ab3..3bc3e64 100644
--- a/src/widgets/efa/efa.scss
+++ b/src/widgets/efa/efa.scss
@@ -24,6 +24,7 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);;
.efa-train {
display: table-row;
color: $title-color;
+ text-align: left;
}
.efa-time {