Skip to content

Instantly share code, notes, and snippets.

@jacobtomlinson
Created January 8, 2020 08:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jacobtomlinson/1eeb098280133a28e77113a7ca04cad7 to your computer and use it in GitHub Desktop.
Save jacobtomlinson/1eeb098280133a28e77113a7ca04cad7 to your computer and use it in GitHub Desktop.
Opsdroid Home Assistant sun lights
from opsdroid_homeassistant import HassSkill, match_sunrise, match_sunset
class SunriseSkill(HassSkill):
@match_sunset
async def lights_on_at_sunset(self, event):
await self.turn_on("light.outside")
@match_sunrise
async def lights_off_at_sunrise(self, event):
await self.turn_off("light.outside")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment