ndg63276 / alexa-sky-hd

A smart home skill for Alexa to control a Sky+HD or SkyQ box
33 stars 15 forks source link

Using multiple SKY-Q boxes #31

Open darkbluedad opened 2 years ago

darkbluedad commented 2 years ago

Haven't tested it or anything, but this commit might help. Obviously you need to add your skybox-002 in appliances again. It won't work for any 'scenes' eg netflix, spotify etc, as then the endpointId becomes the scene name. If you wanted them, you could add them in appliances as well, with a different applianceId, and different friendly name. Then you could edit the code to something like:

if endpointID == 'skybox-002' or endpointID == 'skyq-netflix-2':

Hope that helps, let me know if it works.

Originally posted by @ndg63276 in https://github.com/ndg63276/alexa-sky-hd/issues/11#issuecomment-581611034

darkbluedad commented 2 years ago

To make the code more elegant I'm using a consistent 5 character prefix for the ID for appliance/scenes so I can check the first 5 characters of endpointId to select the Port.

darkbluedad commented 2 years ago

port = int(environ['PORT']) zzzzz = endpointId[:5] if zzzzz == 'study': port = int(environ['PORTSTUDY']) s.connect((environ['HOST'], port))

darkbluedad commented 2 years ago

Just realised that I can use wake-up scenes to avoid having to use sky’s sleep function. I can run an Alexa routine to power down the boxes overnight and wake them again in the morning.