Просмотр исходного кода

oebb: support multiple stations / eva_ids

Fabian Peter Hammerle 7 лет назад
Родитель
Сommit
b3916b07ea
2 измененных файлов с 5 добавлено и 5 удалено
  1. 1 1
      README.md
  2. 4 4
      scripts/omegalines

+ 1 - 1
README.md

@@ -14,7 +14,7 @@ wiener_linien:
   rbl: 4648
 oebb:
   # see http://fahrplan.oebb.at/bin/stboard.exe/dn
-  eva_id: 8101947
+  eva_ids: [8101934, 8101947]
   # optional, default 30 seconds
   update_interval_seconds: 17
 # optional, default: disabled

+ 4 - 4
scripts/omegalines

@@ -194,13 +194,13 @@ def run(config_path):
                 wiener_linien_last_update_time = time.time()
             except urllib2.HTTPError as e:
                 print(e)
-        if 'eva_id' in config['oebb'] \
+        if 'eva_ids' in config['oebb'] \
                 and (oebb_last_update_time is None
                      or time.time() - oebb_last_update_time
                      > config['oebb']['update_interval_seconds']):
-            oebb_departures = request_oebb_departures(
-                eva_id=config['oebb']['eva_id'],
-            )
+            oebb_departures = []
+            for eva_id in config['oebb']['eva_ids']:
+                oebb_departures.extend(request_oebb_departures(eva_id))
             oebb_last_update_time = time.time()
         departures = wiener_linien_departures + oebb_departures
         if 'offset_seconds' in config: