{ "info": { "author": "Eduard van Valkenburg", "author_email": "eduardvanvalkenburg@outlook.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Brunt\nUnofficial python SDK for Brunt, based on the npm version here https://github.com/MattJeanes/brunt-api\n\nThis package allows you to control your Brunt devices from code.\n\n## Sample script\n\nThis script shows the usage and how to use the output of the calls, off course if you already know the name of your device you do not need to call getThings.\n\nThis script checks the current position of a blind called 'Blind' and if that is 100 (fully open), sets it to 90 and vice versa.\n\n```python\nfrom brunt.brunt import BruntAPI\n\nbapi = BruntAPI()\nprint(\"Calling Brunt\")\n\nbapi.login('username', 'password')\nprint(\" Logged in, gettings things.\")\n\nthings = bapi.getThings()['things']\nprint(f\" { len(things) } thing(s) found.\")\n\nstate = bapi.getState(thing='Blind')['thing']\nprint(f\" Current status of { state['NAME'] } is position { state['currentPosition'] }\")\nnewPos = 100\nif int(state['currentPosition']) == 100:\n newPos = 90\nprint(f\" Setting { state['NAME'] } to position { newPos }\")\n\nres = bapi.changeRequestPosition(newPos, thing='Blind')\nprint(' Success!' if res else ' Fail!')\n\n```\n