Skip to content

Commit

Permalink
Fix for python3
Browse files Browse the repository at this point in the history
- Update xbmc.python requirment
- Fix code in lib and addon
  • Loading branch information
marcpaulchand authored and mpolednik committed Apr 7, 2020
1 parent 89fe9ec commit 821f9aa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.kodi.hue.ambilight" name="Kodi Philips Hue" version="1.0" provider-name="Martin Polednik">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="xbmc.python" version="2.26.0"/>
<import addon="script.module.requests"/>
</requires>
<extension point="xbmc.service" library="default.py"></extension>
Expand Down
2 changes: 1 addition & 1 deletion default.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def run():
)
for i in range(len(hue.ambilight_controller.lights)):
algorithm.transition_colorspace(
hue, hue.ambilight_controller.lights.values()[i], hsv_ratios[i], )
hue, list(hue.ambilight_controller.lights.values())[i], list(hsv_ratios)[i], )
except ZeroDivisionError:
pass

Expand Down
6 changes: 3 additions & 3 deletions resources/lib/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def _discover_upnp():

for _ in range(10):
try:
sock.sendto(data, address)
sock.sendto(data.encode('utf-8'), address)
recv, addr = sock.recvfrom(2048)
if 'IpBridge' in recv and 'description.xml' in recv:
bridge_ip = recv.split('LOCATION: http://')[1].split(':')[0]
if str('IpBridge').encode('utf-8') in recv and str('description.xml').encode('utf-8') in recv:
bridge_ip = str(recv).split('LOCATION: http://')[1].split(':')[0]
break
time.sleep(3)
except socket.timeout:
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def readxml(self):

def update(self, **kwargs):
self.__dict__.update(**kwargs)
for k, v in kwargs.iteritems():
for k, v in kwargs.items():
__addon__.setSetting(k, str(v))

def __repr__(self):
Expand Down

0 comments on commit 821f9aa

Please # to comment.