npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pimatic-sunrise

v0.9.3

Published

Events for sunrise, sunset and more

Downloads

7

Readme

pimatic sunrise Plugin

Events for sunrise, sunset and more.

{
  "plugin": "sunrise",
  "latitude": 37.371794,
  "longitude": -122.03476
}

The Plugin uses suncalc. The following events are supported:

  • sunrise: sunrise (top edge of the sun appears on the horizon)
  • sunriseEnd: sunrise ends (bottom edge of the sun touches the horizon)
  • goldenHourEnd: morning golden hour (soft light, best time for photography) ends
  • solarNoon: solar noon (sun is in the highest position)
  • goldenHour: evening golden hour starts
  • sunsetStart: sunset starts (bottom edge of the sun touches the horizon)
  • sunset: sunset (sun disappears below the horizon, evening civil twilight starts)
  • dusk: dusk (evening nautical twilight starts)
  • nauticalDusk: nautical dusk (evening astronomical twilight starts)
  • night: night starts (dark enough for astronomical observations)
  • nightEnd: night ends (morning astronomical twilight starts)
  • nauticalDawn: nautical dawn (morning nautical twilight starts)
  • dawn: dawn (morning nautical twilight ends, morning civil twilight starts)
  • nadir: nadir (darkest moment of the night, sun is in the lowest position)

Note: night and nightEnd have been deprecated as these events yield invalid results for several locations due to a bug in the underlying suncalc package. The night starts and night ends predicates are also affected.

Device Configuration

Optionally, you can setup a SunriseDevice to get sunlight times displayed for a given location. If no location is provided with the device configuration the location given with the plugin configuration applies. The attributes property is used to define which sunlight-related attributes shall be exposed by the device. The name given for an attribute is one of the sunlight event names listed above.

If a label text is set for an attribute the text will be used as an acronym for the attribute on display. Otherwise, the acronym will be constructed from the event name. If the label text is an empty string no acronym will be displayed.

If you wish to obtain the times in the timezone of the location at the given coordinates you can additionally set the timezone property. This will transform the times to the given timezone and will cut off the timezone offsets before converting the resulting times to the localized time string. For a list of valid "TZ" timezone strings, see Wikipedia - List of Timezones.

If the timezone property is absent or the property is set to an empty string no transformation will be performed. Additionally, it is possible to set a utcOffset offset time in hours relative to the timezone. This is useful for example if you wish to neglect daylight savings, i.e. you can set the timezoneto UTC and provide the required utcOffset value.

Note, by default, all times will be given in the local time zone of the system on which pimatic is installed. If you wish to use a different timezone, e.g. universal time to neglect daylight savings, you can set the localTimezone and localUtcOffset properties. However, these properties are only applicable if the timezone property has been set.

{
      "id": "sunrise-1",
      "class": "SunriseDevice",
      "name": "Sunrise",
      "latitude": 52.5072111,
      "longitude": 13.1449592,
      "attributes": [
        {
          "name": "sunrise",
          "label": "Sunrise Time"
        },
        {
          "name": "sunset",
          "label": "Sunset Time"
        }
      ]
}