diff --git a/src/energenie/OnAir.py b/src/energenie/OnAir.py index 1f3db92..692aaf5 100644 --- a/src/energenie/OnAir.py +++ b/src/energenie/OnAir.py @@ -13,7 +13,6 @@ # NOTE: This also might include intelligent power level selection based # on RSSI reports from different devices. -from lifecycle import * import time try: @@ -21,12 +20,14 @@ import OpenThings import TwoBit import radio + from lifecycle import * + except ImportError: # Python 3 from . import OpenThings from . import TwoBit from . import radio - + from .lifecycle import * class OpenThingsAirInterface(): def __init__(self): diff --git a/src/energenie/Registry.py b/src/energenie/Registry.py index de0c10e..9bf3e51 100644 --- a/src/energenie/Registry.py +++ b/src/energenie/Registry.py @@ -114,7 +114,7 @@ def names(self): """A generator/iterator that can be used to get a list of device names""" # first get a list of all devices, in case the registry changes while iterating - devices = self.store.keys() + devices = list(self.store.keys()) # now 'generate' one per call i = 0