Permalink
Browse files

Add OpenELEC case, initialization of settings

1 parent 42bda6f commit 718a5237a164ac5af82128d2cfd6b8207798dbfc @tszczerba tszczerba committed Jun 7, 2014
Showing with 34 additions and 27 deletions.
  1. +32 −25 addon.py
  2. +1 −1 addon.xml
  3. BIN icon.png
  4. +1 −1 resources/settings.xml
View
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 lightberry.eu
+# Copyright (C) 2014 lightberry.eu
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
# along with XBMC; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
-import subprocess
+import subprocess, os
import xbmcaddon
__author__ = "Tomek (lightberry.eu)"
@@ -31,34 +31,41 @@
msgLine = ""
exceptionLine = ""
-colors = { 'black': '000000',
- 'navy': '001F3F',
- 'blue(full)':'0000FF',
- 'blue': '0074D9',
- 'aqua': '7FDBFF',
- 'teal': '39CCCC',
- 'olive': '3D9970',
- 'green(full)':'00FF00',
- 'green': '2ECC40',
- 'lime': '01FF70',
- 'yellow': 'FFDC00',
- 'orange': 'FF851B',
- 'red(full)':'FF0000',
- 'red': 'FF4136',
- 'maroon': '85144B',
- 'fuchsia': 'F012BE',
- 'purple': 'B10DC9',
- 'white': 'FFFFFF',
- 'silver': 'DDDDDD',
- 'gray': 'AAAAAA' }
+colors = {'black': '000000',
+ 'navy': '001F3F',
+ 'blue(full)': '0000FF',
+ 'blue': '0074D9',
+ 'aqua': '7FDBFF',
+ 'teal': '39CCCC',
+ 'olive': '3D9970',
+ 'green(full)': '00FF00',
+ 'green': '2ECC40',
+ 'lime': '01FF70',
+ 'yellow': 'FFDC00',
+ 'orange': 'FF851B',
+ 'red(full)': 'FF0000',
+ 'red': 'FF4136',
+ 'maroon': '85144B',
+ 'fuchsia': 'F012BE',
+ 'purple': 'B10DC9',
+ 'white': 'FFFFFF',
+ 'silver': 'DDDDDD',
+ 'gray': 'AAAAAA'}
-if(__settings__.getSetting('customColor')=='false'):
- command = "hyperion-remote --color " + colors[__settings__.getSetting('constColor')]
+if (__settings__.getSetting('customColor') == 'false'):
+ if os.uname()[1] == "raspbmc":
+ hyperion = "hyperion-remote --color "
+ elif os.uname()[1] == "OpenELEC":
+ hyperion = "/storage/hyperion/bin/hyperion-remote.sh --color "
+ else :
+ hyperion = "hyperion-remote --color "
+
+ command = hyperion + colors[__settings__.getSetting('constColor')]
else:
R = int(float(__settings__.getSetting('customColorR')))
G = int(float(__settings__.getSetting('customColorG')))
B = int(float(__settings__.getSetting('customColorB')))
- command = "hyperion-remote --color " + '{:02x}{:02x}{:02x}'.format(R,G,B)
+ command = "hyperion-remote --color " + '{:02x}{:02x}{:02x}'.format(R, G, B)
subprocess.check_call(command, shell=True)
View
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.service.hyperion-const"
name="Hyperion Constant"
- version="1.0.0"
+ version="1.0.2"
provider-name="lightberry.eu">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -2,7 +2,7 @@
<settings>
<!--MAIN TAB-->
<category label="31000">
- <setting label="31002" id="constColor" type="labelenum" values="black|navy|blue(full)|blue|aqua|teal|olive|green(full)|green|lime|yellow|orange|red(full)|red|maroon|fuchsia|purple|white|silver|gray"/>
+ <setting label="31002" id="constColor" type="labelenum" default="black" values="black|navy|blue(full)|blue|aqua|teal|olive|green(full)|green|lime|yellow|orange|red(full)|red|maroon|fuchsia|purple|white|silver|gray"/>
<setting label="31003" id="customColor" type="bool" default="false" enable="true"/>
<setting label="31031" id="customColorR" type="slider" default="127" range="0,1,255" enable="eq(-1,true)"/>
<setting label="31032" id="customColorG" type="slider" default="127" range="0,1,255" enable="eq(-2,true)"/>

0 comments on commit 718a523

Please sign in to comment.