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

node-red-contrib-sleep-timer

v1.0.2

Published

A timer that works like a TV sleep timer.

Downloads

32

Readme

node-red-contrib-sleep-timer

This node implements the behaviour (logic) of a TV sleep timer, it it designed to be used with nodes that provide communications to TV's.

The project homepage is https://github.com/fizzyade/node-red-contrib-sleep-timer

Features

  • Easy to use, specicifically designed to operate as a TV sleep timer and requires no extra logic to be added which would be required when using a generic timer module.
  • Provides methods for starting, stopping, querying, incrementing and decrementing the timer.
  • Has 3 outputs to enable easy interfacing
    • Control - the control output provides state change messages.
    • Tick - the tick output provides information as the timer counts down.
    • Set - the set output provides information when the timer duration is set.

Behaviour

The logic on the sleep timer is as follows:

  • When a start message is received the timer will be set to either the default or payload timeout period (if supplied).

    Notes:

    The timer will NOT be set if the current value is greater than the requested timeout.

    If the timer is set, then the Control output will send a message with the payload started. If the timer is already running, then this message will not be output.

    A message containing the new timeout value will be output on the Set output.

  • When a stop message is received the timer will be stopped.

    Notes:

    If the timer is running then a stopped message will be sent on the control output, if the timer is not running then no message will be output.

  • When a increment message is received the timer will be incremented by either the default adjustment or payload timeout period (if supplied).

    Notes:

    If the timer is running then the current timeout will be adjusted by the provided period.

    If the timer is not running, then the timer will be started and set to the adjustment period, a started message will be output on the Control output.

    A message containing the new timeout value will be output on the Set output.

  • When a decrement message is received the timer will be decremented by either the default adjustment or payload timeout period (if supplied).

    Notes:

    If the timer is not running then nothing will happen.

    If the timer is running and the current timeout value is less than the adjustment period, then the timer is stopped and a stopped message is output on the Control output. Otherwise the the timer will be decremented by the given amount.

    A message containing the new timeout value will be output on the Set output providing the timer was not stopped by the decrement command.

  • When a remaining message is received, the timer will output the current timeout value

Configuration

The node provides default settings for:

  • Default Period - the default time (in minutes) that the sleep timer will run for when no value is provided in the control payload.
  • Default Adjustment - the default adjustment time (in minutes) that the sleep timer will be adjustmed by when no value is provided in the control payload.

License

This project is open source and is released under the MIT License

Distributed as-is; no warranty is given.