Code Monkey home page Code Monkey logo

squeezebox-ir-events's Introduction

Squeezebox IR Events

A daemon sending IR commands based on Squeezebox events (written in µPython).

The implementation is heavily inspired by ahebrank's script watchpower.py.

Usage

The script is intended to run as a daemon. It automatically restarts itself if the connection to the LMS server is lost. The first argument has to be the name of the configuration file, the second argument is optional, but recommended (the Squeezebox player name).

micropython sb-ir-events.py <CONFIG_FILE> <PLAYER_NAME>

Configuration

The configuration file should be in JSON format:

{
	"player_name": "<LMS player name, can be overridden from command line>",

	"server": {
		"host": "<LMS host name>",
		"port": <port used for the LMS CLI interface>,
		"restart_delay": <delay in seconds before restart if connection is lost>
	},

	"default_script": "<default script, can be set to an empty string>",

	"events": {
		"power:on": [
			{
				"script": "<custom script, optional>",
				"param": "<script parameter, optional>",
				"include_value": <boolean flag to indicate if server response should be added as parameter>
			},
			{
				"delay": <delay in milliseconds before script execution, default 0>,
				"script": "<custom script, optional>",
				"param": "<script parameter, optional>",
			}
		],
		"power:off": [
			{
				"param": "<script parameter>",
			}
		],
		"volume:raise": [
			{
				"param": "<script parameter>",
			}
		],
		"volume:lower": [
			{
				"param": "<script parameter>",
			}
		]
	},
}

squeezebox-ir-events's People

Contributors

mundschenk-at avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.