Skip to content

Commit

Permalink
Add handling for renamed devices
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Reidel <[email protected]>
  • Loading branch information
Gelbpunkt committed Nov 7, 2024
1 parent 9abe478 commit ef720f1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import extensions

RENAMED_DEVICES = {"taranis": "thor", "dagda": "zeus"}

@extensions.cache.memoize()
def get_builds():
try:
Expand All @@ -28,6 +30,8 @@ def get_devices_with_builds():

@extensions.cache.memoize()
def get_device_builds(device):
device = RENAMED_DEVICES.get(device, device)

builds = get_builds()
if device not in builds:
return []
Expand Down Expand Up @@ -93,6 +97,8 @@ def get_devices_data():

@extensions.cache.memoize()
def get_device_data(device):
device = RENAMED_DEVICES.get(device, device)

devices_data = get_devices_data()

for device_data in devices_data:
Expand Down

0 comments on commit ef720f1

Please sign in to comment.