googledevices

Build Status PyPI version Get information from, and control various Google devices.


HOME PLATFORMS CLASSES METHODS FUNCTIONS CLI

Functions Helper functions

gdh_loop

This only returns get_event_loop() from asyncio.

# Sample usage
from googledevices.helpers import gdh_loop
loop = gdh_loop()

gdh_session

This only returns ClientSession() from aiohttp.

# Sample usage
from googledevices.helpers import gdh_session
session = gdh_session()

gdh_sleep

This uses sleep from asyncio with an optional param for the number of seconds, defaults to 5.

# Sample usage
from googledevices.helpers import gdh_sleep
await gdh_sleep(5)

gdh_request

This has a lot of possible params.

param required description
host True Hostname or IP address
port False Port
endpoint False endpoint
json False Bool for if the returned response from the server are JSON or not.
session False Session
loop False Loop
headers False Request headers
data False Data to send with the request
json_data False JSON formated data to send with the request
params False Params to send with the request
method False get or post, defaults to get
# Sample usage
from googledevices.helpers import gdh_request
request = await gdh_request('192.168.2.1')
print(request)