Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Commit

Permalink
Merge branch 'ghys-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mampfes committed Jun 11, 2017
2 parents 66b49e5 + aaa5c39 commit 5ba4cb9
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 51 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
V2.0.1 (11-Jun-2017)
(fix) handle ImageWidget without linkedPage
(fix) set openHAB2 as default server
(fix) moved selection list and color picker to left (PR49e3d14)
(fix) altered colors (PR49e3d14)

V2.0.0 (10-Mar-2017)
(fix) fixed krypton support
(add) openhab2 support
Expand Down
20 changes: 11 additions & 9 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ def build_menu(self):

try:
self.oh.load_sitemaps()
self.homepage = self.oh.sitemaps[ADDON.getSetting('sitemap')].load_page()
try:
sitemap = self.oh.sitemaps[ADDON.getSetting('sitemap')]
except KeyError:
# invalid sitemap -> close window immediately
debugPrint(1, "build_menu failed, host=%s, port=%s, auth=%s, sitemap=%s sitemaps=%s" %
(ADDON.getSetting('host'), ADDON.getSetting('port'),
ADDON.getSetting('authentication'), ADDON.getSetting('sitemap'), self.oh.sitemaps))
xbmcgui.Dialog().ok(ADDON.getLocalizedString(30007), ADDON.getLocalizedString(30206))
self.close()
ADDON.openSettings()
self.homepage = sitemap.load_page()
except requests.exceptions.RequestException as e:
# no connection to openhab server -> close window immediately
debugPrint(1, "build_menu failed, host=%s, port=%s, auth=%s, e=%s" %
Expand All @@ -57,14 +67,6 @@ def build_menu(self):
xbmcgui.Dialog().ok(ADDON.getLocalizedString(30007), ADDON.getLocalizedString(30201))
self.close()
ADDON.openSettings()
except KeyError:
# invalid sitemap -> close window immediately
debugPrint(1, "build_menu failed, host=%s, port=%s, auth=%s, sitemap=%s" %
(ADDON.getSetting('host'), ADDON.getSetting('port'),
ADDON.getSetting('authentication'), ADDON.getSetting('sitemap')))
xbmcgui.Dialog().ok(ADDON.getLocalizedString(30007), ADDON.getLocalizedString(30206))
self.close()
ADDON.openSettings()
self.enter_sub_menu(self.homepage)

def enter_sub_menu(self, page):
Expand Down
7 changes: 5 additions & 2 deletions resources/lib/openhab2.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,10 @@ def __init__(self, page, widgetData):
@update_proxy
def init(self, widgetData):
super(ImageWidget, self).init(widgetData)
self.attribs['linkedPage'] = widgetData['linkedPage'] # don't create an extra Page because not used so far
if 'linkedPage' in widgetData:
self.attribs['linkedPage'] = widgetData['linkedPage'] # don't create an extra Page because not used so far
else:
self.attribs['linkedPage'] = None
self.attribs['url'] = widgetData['url']
self.attribs['refresh'] = int(widgetData.get('refresh', 0))

Expand Down Expand Up @@ -996,7 +999,7 @@ def state_from_string(self, value):
elif value == 'OFF':
return False
else:
raise ValueError
return None #raise ValueError

def state_to_string(self, value):
if value is None:
Expand Down
2 changes: 1 addition & 1 deletion resources/settings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<setting label="30012" id="server" type="enum" lvalues="30120|30121" default="0"/>
<setting label="30012" id="server" type="enum" lvalues="30120|30121" default="1"/>
<setting label="30000" id="host" type="text" default="127.0.0.1"/>
<setting label="30001" id="port" type="number" default="8080"/>
<setting label="30006" type="action" action="RunScript(script.module.openhab, show_sitemaps)"/>
Expand Down
48 changes: 24 additions & 24 deletions resources/skins/Default/720p/colorpicker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<defaultcontrol always="true">100</defaultcontrol>
<coordinates>
<system>1</system>
<left>340</left>
<top>40</top>
<left>100</left>
<top>60</top>
</coordinates>
<allowoverlay>yes</allowoverlay>
<include>dialogeffect</include>
Expand All @@ -22,26 +22,26 @@
<control type="panel" id="100">
<left>30</left>
<top>82</top>
<width>544</width>
<height>304</height>
<width>200</width>
<height>110</height>
<onup>100</onup>
<ondown>100</ondown>
<onleft>100</onleft>
<onright>100</onright>
<orientation>horizontal</orientation>
<scrolltime>200</scrolltime>
<itemlayout height="60" width="60">
<itemlayout height="22" width="22">
<control type="group">
<left>4</left>
<top>4</top>
<left>2</left>
<top>2</top>
<control type="image">
<width>56</width>
<height>56</height>
<width>20</width>
<height>20</height>
<texture>$INFO[ListItem.Art(thumb)]</texture>
</control>
<control type="label">
<width>56</width>
<height>56</height>
<width>20</width>
<height>20</height>
<align>center</align>
<aligny>center</aligny>
<font>font13_title</font>
Expand All @@ -50,8 +50,8 @@
<visible>ListItem.IsSelected + !StringCompare(ListItem.Label, FF000000)</visible>
</control>
<control type="label">
<width>56</width>
<height>56</height>
<width>20</width>
<height>20</height>
<align>center</align>
<aligny>center</aligny>
<font>font13_title</font>
Expand All @@ -61,25 +61,25 @@
</control>
</control>
</itemlayout>
<focusedlayout height="60" width="60">
<focusedlayout height="22" width="22">
<control type="image">
<left>0</left>
<top>0</top>
<width>64</width>
<height>64</height>
<width>24</width>
<height>24</height>
<texture>colors/FFFFFFFF.png</texture>
</control>
<control type="group">
<left>4</left>
<top>4</top>
<left>2</left>
<top>2</top>
<control type="image">
<width>56</width>
<height>56</height>
<width>20</width>
<height>20</height>
<texture>$INFO[ListItem.Art(thumb)]</texture>
</control>
<control type="label">
<width>56</width>
<height>56</height>
<width>20</width>
<height>20</height>
<align>center</align>
<aligny>center</aligny>
<font>font13_title</font>
Expand All @@ -88,8 +88,8 @@
<visible>ListItem.IsSelected + !StringCompare(ListItem.Label, FF000000)</visible>
</control>
<control type="label">
<width>56</width>
<height>56</height>
<width>20</width>
<height>20</height>
<align>center</align>
<aligny>center</aligny>
<font>font13_title</font>
Expand Down
4 changes: 2 additions & 2 deletions resources/skins/Default/720p/menulist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
<width>400</width>
<height>35</height>
<font>font13_title</font>
<textcolor>blue</textcolor>
<textcolor>FFEE6E73</textcolor>
<info>ListItem.Label</info>
<visible>StringCompare(ListItem.Property(type), separator)</visible>
</control>
Expand Down Expand Up @@ -369,7 +369,7 @@
<width>400</width>
<height>35</height>
<font>font13_title</font>
<textcolor>blue</textcolor>
<textcolor>FFEE6E73</textcolor>
<info>ListItem.Label</info>
<visible>StringCompare(ListItem.Property(type), separator)</visible>
</control>
Expand Down
26 changes: 13 additions & 13 deletions resources/skins/Default/720p/selectdialog.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<window id="5534">
<coordinates>
<posx>340</posx>
<posy>40</posy>
<posx>100</posx>
<posy>60</posy>
</coordinates>
<include>dialogeffect</include>
<controls>
Expand All @@ -20,7 +20,7 @@
<control type="list" id="1100">
<posx>20</posx>
<posy>70</posy>
<width>540</width>
<width>200</width>
<height>495</height>
<onup>1100</onup>
<ondown>1100</ondown>
Expand All @@ -32,47 +32,47 @@
<control type="image">
<posx>0</posx>
<posy>0</posy>
<width>540</width>
<width>200</width>
<height>40</height>
<texture border="5">button-nofocus.png</texture>
<texture border="5">default/button-nofocus.png</texture>
</control>
<control type="label">
<posx>20</posx>
<posy>0</posy>
<width>500</width>
<width>160</width>
<height>40</height>
<font>font13</font>
<align>left</align>
<aligny>center</aligny>
<textcolor>grey2</textcolor>
<selectedcolor>selected</selectedcolor>
<textcolor>FF999999</textcolor>
<selectedcolor>FFEE6E73</selectedcolor>
<info>ListItem.Label</info>
</control>
</itemlayout>
<focusedlayout height="45">
<control type="image">
<posx>0</posx>
<posy>0</posy>
<width>540</width>
<width>200</width>
<height>40</height>
<texture border="5">button-focus2.png</texture>
<texture border="5">default/button-focus.png</texture>
</control>
<control type="label">
<posx>20</posx>
<posy>0</posy>
<width>500</width>
<width>160</width>
<height>40</height>
<font>font13</font>
<align>left</align>
<aligny>center</aligny>
<textcolor>white</textcolor>
<selectedcolor>selected</selectedcolor>
<selectedcolor>FFEE6E73</selectedcolor>
<info>ListItem.Label</info>
</control>
</focusedlayout>
</control>
<control type="scrollbar" id="1101">
<posx>560</posx>
<posx>240</posx>
<posy>70</posy>
<width>25</width>
<height>495</height>
Expand Down

0 comments on commit 5ba4cb9

Please sign in to comment.