diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dda7921 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +[tool.poetry] +name = "switchbotpy" +version = "0.1.9" +description = "An API for Switchbots that allows to control actions, settings and timers (also password protected)" +authors = ["Nicolas Küchler "] +readme = "README.md" +license = "MIT" +keywords = ["Switchbot", "Ble", "Button", "Actions", "Settings", "Timers"] +classifiers=[ + 'Development Status :: 3 - Alpha', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', +] + +[tool.poetry.dependencies] +python = "^3.6" +pygatt = "^4.0.5" +pexpect = "^4.8.0" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 224a779..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 2320bfa..0000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -from setuptools import setup - -with open("README.md", "r") as fh: - long_description = fh.read() - -setup( - name='switchbotpy', - packages=['switchbotpy'], - version='0.1.7', - license='MIT', - description='An API for Switchbots that allows to control actions, settings and timers (also password protected)', - long_description=long_description, - long_description_content_type="text/markdown", - author='Nicolas Küchler', - author_email='nico.kuechler@protonmail.com', - url='https://github.com/RoButton/switchbotpy', - download_url='https://github.com/RoButton/switchbotpy/archive/v_017.tar.gz', - keywords=['Switchbot', 'Ble', 'Button', 'Actions', 'Settings', 'Timers'], - install_requires=['pygatt', 'pexpect'], - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Build Tools', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - ], -) diff --git a/switchbotpy/switchbot_util.py b/switchbotpy/switchbot_util.py index 9ece639..9ea947b 100644 --- a/switchbotpy/switchbot_util.py +++ b/switchbotpy/switchbot_util.py @@ -13,6 +13,7 @@ def handle_notification(handle: int, value: bytes): class ActionStatus(Enum): complete = 1 device_busy = 3 + cmd_not_supported = 5 device_unreachable = 11 device_encrypted = 7 device_unencrypted = 8 @@ -26,6 +27,8 @@ def msg(self): msg = "action complete" elif self == ActionStatus.device_busy: msg = "switchbot is busy" + elif self == ActionStatus.cmd_not_supported: + msg = "Device does not support this Command" elif self == ActionStatus.device_unreachable: msg = "switchbot is unreachable" elif self == ActionStatus.device_encrypted: