Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trigger_switch_d

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trigger_switch_d

  • 0.1.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

== trigger_switch_d

  • http://github.com/pfspontus/trigger_switch_d

== LICENSE

See link:LICENSE.txt

== REQUIREMENTS

Mac OSX

== DESCRIPTION

Scheduled (tsd) is run as a daemon without any need for user interaction. It sends commands to remote triggered devices such as lamps and switches, to activate/deactive them at scheduled times.

== INSTALLATION

  1. Get source

    git clone git://github.com/pfspontus/trigger_switch_d.git

  2. install gem:

    sudo gem install trigger_switch_d

== USAGE

Before running tsd you need to do a few things.

  1. Setup required folders and files (home or system) by running

    ts_setup (home|system)

make the necessary adjustments in environment.rb

  1. Register you remote triggered devices in a file called devices using the following format (yaml):
---
- name: "yttertrapp"
  switches: 
  - unit_code: "5"
    house_code: A
    model_name: plain_tex
  1. Create a schedule in a file called scheduled_actions using the following format:

    tänd yttertrapp klockan 08:15

where "tänd" is the action, yttertrapp is the device etc. Available actions are "tänd" and "släck". Device names are the ones from step 1.

  1. Copy the files devices and scheduled_actions to the sub-directory db

  2. run tsd

== COMMUNICATING WITH TSD WHEN IT IS RUNNING

Start IRB from a terminal and use UNIXSocket.open("/tmp/com.adhocskill.trigger_switch_d") to open a socket. Strings that tsd will respond to are:

  • list_schedule
  • list_devices
  • bye (disconnects client socket without stopping daemon)
  • stop (disconnects client socket and stops daemon)

The list of strings (commands) will get longer with time.

Here's an example session:

bq. >> sock = UNIXSocket.open("/tmp/com.adhocskill.trigger_switch_d")
=> #UNIXSocket:0x1017ede78

sock.send("list_schedule",0)
=> 13
puts sock.recvfrom(1000)[0]
---

  • "släck källare vid soluppgång"
  • "släck källare klockan 00:15"
  • "tänd källare klockan 04:00"
  • "tänd yttertrapp vid solnedgång"
  • "släck yttertrapp vid soluppgång"
  • "tänd källare vid solnedgång"
    => nil

sock.send("bye",0)
=> 3
puts sock.recvfrom(1000)[0]
bye
=> nil

== SUNRISE AND SUNSET

You can schedule an action to occur at sunrise or sunset by typing "vid soluppgång" or "vid solnedgång" instead of "klockan HH:MM" when you schedule your actions. As and example:

släck yttertrapp vid soluppgång

== LOCALE

The file lookup.dsl in the config folder, contains words associated with the actions. The file is pretty much self explanatory feel free to set the words to the language of your choice.

== FILE STRUCTURE

bin			executable scripts
config		environment files
db			files used by tsd
doc			rdoc documentation of the whole project
feature		cucumber feature/step files
lib			project source
log			scheduled puts a running log here
sample		some sample files to put in db or config
spec			rspec bdd files

FAQs

Package last updated on 19 Apr 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc