Created
August 26, 2017 22:00
-
-
Save Just-Insane/ac1e7161b8eec02b02eb91a47600a930 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@commands.command() | |
async def on(self): | |
while self == self.bot.get_cog("Hass"): | |
url = "http://10.0.1.147:8123/api/services/light/turn_on" | |
headers = { | |
"x-ha-access": '[api_key]', | |
"Content-Type": "application/json" | |
} | |
data = { | |
"entity_id": "light.justin_bedroom", | |
"brightness": "255" | |
} | |
async with aiohttp.post(url, headers=headers, data=data) as resp: | |
time.sleep(10) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment