API to make request for PWBUS. Developed for the following frameworks Flask, Bottle
Project description
pwbus-request
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.4.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for pwbus_request-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67c6a4a047070bef619428250b6b7b7031d64a5bd5b0ce094cbfcb480e99c156 |
|
MD5 | 865291f4e3443a3484edecf5582734be |
|
BLAKE2b-256 | d58b851ca1c5ae7d90c55ee8c79ee73ac2a0b5eb369b4f9b59ab3bac56796d20 |