From 7eba4293714b9dce86c07ccf2fdaddaa11a4c3c7 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 28 Aug 2015 23:39:37 +0200 Subject: Reaktor: add nix support, packaging --- commands/licht_resolver | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100755 commands/licht_resolver (limited to 'commands/licht_resolver') diff --git a/commands/licht_resolver b/commands/licht_resolver deleted file mode 100755 index 5bdb651..0000000 --- a/commands/licht_resolver +++ /dev/null @@ -1,37 +0,0 @@ -#! /usr/bin/python -# -*- coding: utf-8 -*- - -map = { - 'shackspace': { - 'device': { - 0: 'Licht0, Zickenzone; Fenster', - 1: 'Licht1, Sofaecke; Fenster', - 2: 'Licht2, Zickenzone; Ghetto', - 3: 'Licht3, Sofaecke; Ghetto', - 4: 'Licht4, Richtung Getränkelager', - 5: 'Licht5, Porschekonsole', - 6: 'Licht6, Tomatenecke', - 7: 'Licht7, Ghetto', - 10: 'Hauptschalter' - }, - 'state': { - 0: 'aus', - 1: 'an', - 2: 'aus in T-10s' - }, - '->': 'ist' - } -} - -from struct import unpack -import json -from os import environ as env - -location = "shackspace" - -map = map[location] -print (env["payload"]+"") -did, sid= unpack('BB', json.loads(env['payload'])) -device,state = map['device'][did], map['state'][sid] -arrow = map['->'] -print ' '.join([device, arrow, state]) -- cgit v1.2.3