Skip to content

Commit 281da2a

Browse files
GelbpunktArianK16a
authored andcommitted
Add handling for renamed devices
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
1 parent 68e9b3c commit 281da2a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

api_common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import extensions
1313

14+
RENAMED_DEVICES = {"taranis": "thor", "dagda": "zeus"}
15+
1416
@extensions.cache.memoize()
1517
def get_builds():
1618
try:
@@ -28,6 +30,8 @@ def get_devices_with_builds():
2830

2931
@extensions.cache.memoize()
3032
def get_device_builds(device):
33+
device = RENAMED_DEVICES.get(device, device)
34+
3135
builds = get_builds()
3236
if device not in builds:
3337
return []
@@ -93,6 +97,8 @@ def get_devices_data():
9397

9498
@extensions.cache.memoize()
9599
def get_device_data(device):
100+
device = RENAMED_DEVICES.get(device, device)
101+
96102
devices_data = get_devices_data()
97103

98104
for device_data in devices_data:

0 commit comments

Comments
 (0)