Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/bin/python3
- from smartThingy import *
- import aiohttp
- import asyncio
- import pysmartthings
- async def run(loop):
- api = await getApi(token,session)
- locations = await getLocations(api)
- devices = await getDevices(api)
- closet = await getDeviceByName(devices,"Print Light")
- print(f" \r\r\n\n{api} \n\r connected to SmartThings! \r\n {locations} \r\n Recieved all locations \r\n Receieved all Devices")
- print("------------------------------------- \r\n")
- await toggleSwitch(closet)
- await session.close() #have in all files!
- return None
- token = "TOKEN THAT HAS BEEN REMOVED FOR SECURITY"
- session= aiohttp.ClientSession()
- loop = asyncio.get_event_loop()
- loop.run_until_complete(run(loop))
Add Comment
Please, Sign In to add comment