Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
[RUNTIME] Fix incorrect _hibike_get_uid (#640)
Browse files Browse the repository at this point in the history
Return the UID instead of the device information.
  • Loading branch information
baby-bell authored Oct 19, 2018
1 parent 88ff58c commit 5919324
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion runtime/runtimeUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import json

__version__ = (1, 3, 0)
__version__ = (1, 3, 1)


class AutoIntEnum(IntEnum):
Expand Down
4 changes: 3 additions & 1 deletion runtime/studentapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ def _hibike_get_uid(self, name):
try:
# TODO: Implement sensor mappings, right now uid is the number (or string of number)
device = int(name)
return self.peripherals[device]
if device in self.peripherals:
return device
raise KeyError(str(device))
except (ValueError, KeyError) as exc:
raise StudentAPIKeyError('Device not found: ' + str(name)) from exc

Expand Down

0 comments on commit 5919324

Please sign in to comment.