Search found 46 matches

by Peter M
Fri Jun 05, 2020 7:38 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

I decide that this wasn't worth spending any more time on as it applies to such a small subset of my music.

So I've ended up editing out all the accented characters in Artist and Album names.

Thanks again for all your help.

Cheers,
Peter
by Peter M
Sat May 30, 2020 5:54 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

Different error - Traceback (most recent call last): Python script "67", line 160, in <module> send(artist.format(track, item.find('creator').text)) Python script "67", line 135, in format return str.format(self, *args) UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 4: ...
by Peter M
Fri May 29, 2020 5:35 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

OK here's the error message from that one - Traceback (most recent call last): Python script "66", line 117, in <module> xml = ElementTree.fromstring(data.decode('utf-8')) File "encodings\utf_8.pyc", line 16, in decode UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1223...
by Peter M
Thu May 28, 2020 1:58 pm
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

Here's the latest code - import requests data = '''\ <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"> <ObjectID>Q:0</ObjectID> <BrowseFlag>BrowseD...
by Peter M
Wed May 27, 2020 12:35 pm
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

I made a couple of minor changes to this section - for track, item in enumerate(xml, start=1): send(artist.format(track, item.find('creator').text)) send(title.format(track, item.find('title').text)) if track ==1: send(artist.format('', item.find('creator').text, replace=True)) send(album.format('',...
by Peter M
Fri May 22, 2020 8:42 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

When there are less than 10 items in the queue the repeat is always on the last one. Here it's artist5 and title5 - udp.artist1:Hunters & Collectors: udp.title1:True Tears of Joy: udp.artist2:Hunters & Collectors: udp.title2:Where Do You Go?: udp.artist3:Hunters & Collectors: udp.title3:Back in the ...
by Peter M
Fri May 22, 2020 7:43 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

A couple of problems. 1. It's no longer sending artist and album, and instead its sending two artist10 and title10 with the second ones blank - udp.artist1:k.d. lang: udp.title1:Season of Hollow Soul: udp.artist2:k.d. lang: udp.title2:Constant Craving: udp.artist3:Kate Bush: udp.title3:Wuthering Hei...
by Peter M
Wed May 20, 2020 8:29 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

Here's the latest - import requests data = '''\ <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"> <ObjectID>Q:0</ObjectID> <BrowseFlag>BrowseDirect...
by Peter M
Mon May 18, 2020 11:33 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

So I thought I'd fixed the problem with accented characters but not entirely it appears. The original album that gave me problems had a composer name with accented e and my fix allowed the py code to run without errors. Note that I don't use the data in the composer field. Now I've come across an ar...
by Peter M
Sun May 17, 2020 4:44 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

FYI - this is my Sonos page from Demopad -
.
sonos page.png
.
Cheers,
Peter
by Peter M
Sat May 16, 2020 8:29 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

Studying your code and trying to solve the little teething issues that arise is certainly helping me learn more about python. The hardest part is knowing where to start. Once I see you use a function or method, then Google provides a wealth of extra info. I feel confident that if I decide to extend ...
by Peter M
Sat May 16, 2020 6:45 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

I've also got the changes to the mouse event and payload working.

The only addition was that after this -

Code: Select all

x, y = eg.event.payload
I needed this -

Code: Select all

x = int(x)
y = int(y)
Once again thanks very much for your help !

Cheers,
Peter
by Peter M
Sat May 16, 2020 6:04 am
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

A bit of searching on StackOverflow led me to this solution for the accented characters -

Code: Select all

xml = ElementTree.fromstring(data.encode('utf-8'))
All seems to be working now.

Cheers,
Peter
by Peter M
Fri May 15, 2020 12:23 pm
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

This is what I've ended up with - import requests data = '''\ <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"> <ObjectID>Q:0</ObjectID> <BrowseFla...
by Peter M
Fri May 15, 2020 12:07 pm
Forum: General Support
Topic: IP controlled relay board
Replies: 72
Views: 11524

Re: IP controlled relay board

All was working really well and I had the info going back to Demopad and then suddenly it was throwing up these errors - Traceback (most recent call last): Python script "31", line 118, in <module> xml = ElementTree.fromstring(data) File "xml\etree\ElementTree.pyc", line 963, in XML File "xml\etree\...