sun
Platypush documentation
sun
- class platypush.plugins.sun.SunPlugin(latitude: float, longitude: float, **kwargs)[source]
Bases:
RunnablePlugin
Plugin to get sunset/sunrise events and info for a certain location.
Triggers:
platypush.message.event.sun.SunriseEvent
on sunrise.platypush.message.event.sun.SunsetEvent
on sunset.
- __init__(latitude: float, longitude: float, **kwargs)[source]
- Parameters:
latitude – Default latitude.
longitude – Default longitude.
- get_events(latitude: Optional[float] = None, longitude: Optional[float] = None) dict [source]
Return the next sun events.
- Parameters:
latitude – Default latitude override.
longitude – Default longitude override.
- Returns:
{ "astronomical_twilight_begin": "Next astronomical twilight start time", "astronomical_twilight_end": "Next astronomical twilight end time", "civil_twilight_begin": "Next civil twilight start time", "civil_twilight_end": "Next civil twilight end time", "nautical_twilight_begin": "Next nautical twilight start time", "nautical_twilight_end": "Next nautical twilight end time", "solar_noon": "Next solar noon time", "sunrise": "Next sunrise time", "sunset": "Next sunset time" }