Library for interfacing with Blastbot Cloud
Project description
Blastbot Cloud API Python
Blastbot Cloud API Client for python
Installation
blastbot-cloud-api-python is supported on Python 3.7+. The recommended way to install it is via pip.
pip install blastbot-cloud-api-python
Usage
The library is built with asyncio and aiohttp, that means that most of the functions are async and need to run inside the asyncio event loop.
See usage examples in main.py
.
TLDR:
# Initialize
api = BlastbotCloudAPI()
success = await api.async_login(EMAIL, PASSWORD)
# ... do your stuff with api ...
# IMPORTANT: Always close the session before exiting
await api.async_close()
Reference
blastbot_cloud_api.api
BlastbotCloudAPI
- async_close(): Closes underlying aiohttp session
- async_login(email: str, password: str) -> bool: Logs in to Blastbot Cloud, returns if successful
- async_get_devices() -> List[Device]: Get devices
- async_get_device(id: int) -> Device: Get a specific device
- async_get_controls(type: str = None) -> List[Control]: Get controls, optionally filter by type (switch, ac or ir)
- async_get_control(id: int) -> Control: Get a specific control
- async_get_switches() -> List[Control]: Get all switch controls
- async_get_acs() -> List[Control]: Get al AC controls
- async_get_irs() -> List[Control]: Get all ir/rf controls
blastbot_cloud_api.models.device
Device
- id: int
- address: int
- bridge: dict
- bridgeId: int
- config: dict
- connected: bool
- mac: str
- state: str
- version: str
- name: str
- type: str
- async_update(): Updates device data from Blastbot Cloud
blastbot_cloud_api.models.control
Control
- id: int
- deviceId: int
- name: str
- type: str: (switch, ac or ir)
- acSettings: dict
- buttons: List[dict]
- device: dict
- switches: List[dict]
- switch_state() -> bool: Get switch state (for switch controls)
- async_control_button(button_id: int): Execute a button action (for ir/rf controls)
- async_control_switch(is_on: bool): Control a switch (for switch controls)
- async_control_ac(state: str = None, temperature: str = None, fan: str = None): Control the ac state (for ac controls)
- state: "on" or "off"
- temperature: number of ºC in string
- fan: one of "auto", "low", "medium" or "high"
- async_update(): Update control data from Blastbot Cloud
Contributing
Development Requirements
- python 3.8
- pipenv
Development setup
On macOS:
brew install python
brew install pipenv
Inside this folder:
pipenv shell --python=3.8
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file blastbot-cloud-api-python-0.1.2.tar.gz
.
File metadata
- Download URL: blastbot-cloud-api-python-0.1.2.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29201040950839ab666abf7f7f386277092f3d9eace5470030ad98767bedaedc |
|
MD5 | eecd493aabb20c848fce6dedb44eee78 |
|
BLAKE2b-256 | dcc56e2bbea99290f02ea13f72e187b4a180342a82a046bc3bb2491d25767273 |
File details
Details for the file blastbot_cloud_api_python-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: blastbot_cloud_api_python-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f56744ec28ec8b52c7f5724644e4f55ef1390539b666b9df9cc150e97a5718df |
|
MD5 | 9e80404a866ad6e2e97cfe38625f99ef |
|
BLAKE2b-256 | 23e111d40f784fdb0f7a7c22b281183b03ba3eb6cd17349a7a143fbed315ce78 |