diff --git a/crownstone_cloud/lib/__init__.py b/crownstone_cloud/lib/__init__.py index 47ca2b3..c12d127 100644 --- a/crownstone_cloud/lib/__init__.py +++ b/crownstone_cloud/lib/__init__.py @@ -1,3 +1,3 @@ """Library that communicates with the Crownstone lib""" -__version__ = '1.1.1' \ No newline at end of file +__version__ = '1.1.3' \ No newline at end of file diff --git a/crownstone_cloud/lib/cloud.py b/crownstone_cloud/lib/cloud.py index e288cd6..ec0a4ef 100644 --- a/crownstone_cloud/lib/cloud.py +++ b/crownstone_cloud/lib/cloud.py @@ -28,9 +28,6 @@ def __init__( # data self.spheres: Optional[Spheres] = None - def __del__(self): - self.reset() - async def initialize(self) -> None: """Async initialize the cloud data""" if RequestHandler.access_token is None: @@ -91,7 +88,6 @@ def get_crownstone_by_id(self, crownstone_id) -> Crownstone: def reset() -> None: """Cleanup the request handler instance data""" RequestHandler.access_token = None - RequestHandler.websession = None RequestHandler.login_data = None @staticmethod diff --git a/crownstone_cloud/lib/cloudModels/crownstones.py b/crownstone_cloud/lib/cloudModels/crownstones.py index 60fd312..a83bedb 100644 --- a/crownstone_cloud/lib/cloudModels/crownstones.py +++ b/crownstone_cloud/lib/cloudModels/crownstones.py @@ -68,12 +68,16 @@ def find(self, crownstone_name: str) -> object or None: if crownstone_name == crownstone.name: return crownstone - return None - def find_by_id(self, crownstone_id) -> object or None: """Search for a crownstone by id and return crownstone object if found""" return self.crownstones[crownstone_id] + def find_by_uid(self, crownstone_uid) -> object or None: + """Search for a crownstone by uid and return crownstone object if found""" + for crownstone in self.crownstones.values(): + if crownstone_uid == crownstone.unique_id: + return crownstone + class Crownstone: """Represents a Crownstone""" diff --git a/setup.py b/setup.py index 858a78b..f2e753e 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,19 @@ from setuptools import setup, find_packages +with open("README.md", "r") as fh: + long_description = fh.read() + setup( - name='crownstone-lib-python-cloud', - version='1.1.1', + name='crownstone-cloud', + version='1.1.3', + long_description=long_description, + long_description_content_type="text/markdown", url='https://github.com/crownstone/crownstone-lib-python-cloud', author='Crownstone B.V.', - description='Async library to get & store data from the Crownstone cloud.', packages=find_packages(exclude=['examples', 'tests']), - platforms='any', install_requires=list(package.strip() for package in open('requirements.txt')), classifiers=[ 'Programming Language :: Python :: 3.7' - ] + ], + python_requires='>=3.7', )