{"id":17919924,"url":"https://github.com/eavanvalkenburg/brunt-api","last_synced_at":"2025-09-09T16:47:14.732Z","repository":{"id":32531361,"uuid":"136196340","full_name":"eavanvalkenburg/brunt-api","owner":"eavanvalkenburg","description":"Unofficial API for Brunt, based on the npm version here https://github.com/MattJeanes/brunt-api","archived":false,"fork":false,"pushed_at":"2022-02-17T09:24:46.000Z","size":100,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-24T06:25:21.061Z","etag":null,"topics":["api","blind","brunt","bruntblind","bruntblindengine","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eavanvalkenburg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-05T15:15:02.000Z","updated_at":"2023-05-28T15:03:41.000Z","dependencies_parsed_at":"2022-08-07T17:45:11.847Z","dependency_job_id":null,"html_url":"https://github.com/eavanvalkenburg/brunt-api","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eavanvalkenburg%2Fbrunt-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eavanvalkenburg%2Fbrunt-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eavanvalkenburg%2Fbrunt-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eavanvalkenburg%2Fbrunt-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eavanvalkenburg","download_url":"https://codeload.github.com/eavanvalkenburg/brunt-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221926092,"owners_count":16902822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blind","brunt","bruntblind","bruntblindengine","python"],"created_at":"2024-10-28T20:19:56.934Z","updated_at":"2024-10-28T20:19:57.440Z","avatar_url":"https://github.com/eavanvalkenburg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/brunt.svg)](https://badge.fury.io/py/brunt)\n\n# 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 import BruntClient, BruntClientAsync\n\nbapi = BruntClient() \n# bapi = BruntClientAsync()\nprint(\"Calling Brunt\")\n\nbapi.login('username', 'password')\n# await bapi.async_login('username', 'password')\nprint(\"    Logged in, gettings things.\")\n\nthings = bapi.get_things()['things']\n# things = await bapi.async_get_things()['things']\nprint(f\"    { len(things) } thing(s) found.\")\n\nstate = bapi.get_state(thing='Blind')['thing']\n# state = await bapi.async_get_state(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.change_request_position(newPos, thing='Blind')\n# res = await bapi.async_change_request_position(newPos, thing='Blind')\nprint('    Success!' if res else '    Fail!')\n    \n```\n\u003ch1 id=\"brunt.BruntClient\"\u003eBruntClient \u0026 BruntClientAsync\u003c/h1\u003e\n\n```python\nfrom brunt import BruntClient\nBruntClient(username, password)\n\nor \n\nfrom brunt import BruntClientAsync\nBruntClientAsync(username, password, session)\n```\nConstructor for the API wrapper.\n\nIf you supply username and password here, they are stored, but not used.\nAuto logging in then does work when calling another method, no explicit login needed.\n\n:param username: the username of your Brunt account\n:param password: the password of your Brunt account\n\nAsync only :param session: aiohttp.ClientSession object\n\n\u003ch2 id=\"brunt.BruntClient.login\"\u003elogin\u003c/h2\u003e\n\n```python\nBruntClient.login(self, username, password)\nawait BruntClient.async_login(self, username, password)\n```\nLogin method using username and password\n\n:param username: the username of your Brunt account\n:param password: the password of your Brunt account\n\n:return: True if successful\n:raises: errors from Requests call\n\n\u003ch2 id=\"brunt.brunt.BruntClient.getThings\"\u003eget_things\u003c/h2\u003e\n\n```python\nBruntClient.get_things(self)\nawait BruntClient.async_get_things(self)\n```\nGet the things registered in your account\n\n:return: List of Things\n:raises: errors from Requests call\n\n\u003ch2 id=\"brunt.brunt.BruntClient.getState\"\u003eget_state\u003c/h2\u003e\n\n```python\nBruntClient.get_state(self, thing=\"Blind\")\nawait BruntClient.async_get_state(self, thing=\"Blind\")\n```\nGet the state of a thing, by NAME or thingUri\n\n:param thing: a string with the NAME of the thing, which is then checked against the names of all the things.\n:param thingUri: Uri (string) of the thing you are getting the state from, not checked against getThings.\n\n:return: a Thing.\n:raises: ValueError if the requested thing does not exists. NameError if not logged in. SyntaxError when\n    not exactly one of the params is given.\n\n\u003ch2 id=\"brunt.brunt.BruntClient.changeRequestPosition\"\u003echange_request_position\u003c/h2\u003e\n\n```python\nBruntClient.change_request_position(self, request_position, thing=\"Blind\")\nawait BruntClient.async_change_request_position(self, request_position, thing=\"Blind\")\n```\nChanges the position of the thing. Internally calls the changeKey method with key set to\nrequestPosition and value set to request_position\n\n:param request_position: The new position for the slide (0-100)\n:param thing: a string with the name of the thing, which is then checked against the names of all the things.\n:param thingUri: Uri (string) of the thing you are getting the state from, not checked against getThings.\n\n:return: a dict with 'result'.\n:raises: ValueError if the requested thing does not exists or the position is not between 0 and 100.\n    NameError if not logged in. SyntaxError when not exactly one of the params is given.\n\n\u003ch2 id=\"brunt.brunt.BruntClient.changeKey\"\u003echange_key\u003c/h2\u003e\n\n```python\nBruntClient.change_key(self, key=\"requestPosition\", value=\"100\", thing=\"Blind\")\nawait BruntClient.async_change_key(self, key=\"requestPosition\", value=\"100\", thing=\"Blind\")\n```\nChange a variable of the thing by supplying the key and value. Mostly included for future additions.\n\n:param key: The key of the value you want to change\n:param value: The new value\n:param thing: a string with the name of the thing, which is then checked using getThings.\n:param thingUri: Uri (string) of the thing you are getting the state from, not checked against getThings.\n:return: a dict with 'result'.\n:raises: ValueError if the requested thing does not exists or the position is not between 0 and 100. \n    NameError if not logged in. SyntaxError when not exactly one of the params is given. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feavanvalkenburg%2Fbrunt-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feavanvalkenburg%2Fbrunt-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feavanvalkenburg%2Fbrunt-api/lists"}