API to make request for PWBUS. Developed for the following frameworks Flask, Bottle
Project description
pwbus-web
API to make request for PWBus.
Install:
$ pip3 install pwbus-request
Bootle request
@get('/ping')
def ping():
print("PING (request)")
sys.stdout.flush()
try:
pwbus = PwbusBootleRequest(
request=request,
response=response,
channel="scarlet-web-channel",
task_id="pwbus.Pwbus_ping_task"
)
headers = pwbus.getHeaders()
if pwbus.isRetry():
payload = {}
else:
payload = {'value': 'PING'}
resp = pwbus.post(payload, headers)
return json.dumps({'success': True, 'data': resp["data"]})
except:
traceback.print_exc()
sys.stdout.flush()
return json.dumps({'success': False})
Flask request
TODO
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
pwbus-request-0.1.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for pwbus_request-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e858e9fe8eaea6406833a798f55490fcf53f63adc1d9f032cb2f79dd6db017b8 |
|
MD5 | 975b723baf7b347506f79295f75db543 |
|
BLAKE2b-256 | 5c9aa3c3328569a055434ad190d9b487e77433c159d3ffae0067248272700d08 |