Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending multiple POST commands #77

Closed
librien opened this issue Oct 31, 2017 · 2 comments
Closed

Sending multiple POST commands #77

librien opened this issue Oct 31, 2017 · 2 comments

Comments

@librien
Copy link

librien commented Oct 31, 2017

I understand this isn't the forum for technical support, but I am having trouble with sending multiple sequenced commands to my hub, and am not sure where the problem is.

I wrote a script to turn on an activity and then change the channel on my STB. If the activity is already on, the script works and it will change the channel successfully. If the harmony hub is off, or is set to a different activity, and the script needs to turn on, or change activities, and then send the commands to change channel, it will not work.

The first part works, it turns on / changes activity. I added a delay to the commands to change the channel in case that was the problem, this didn't change anything. When I send the commands, I do receive Response [200], so I know harmony-api is receiving the commands. It just looks like it is not relaying them properly? If I then run the script again after the hub / activity is on, it changes the channel correctly. Is there something I need to do to break the connection and resend the commands?

@maddox
Copy link
Owner

maddox commented Oct 31, 2017

harmony-api doesn't have any kind of queue. So when you send those commands back to back, they're being relayed immediately (asynchronously) to the harmony hub. That's probably where the problem lies.

I know it's not great, but try adding some time between requests.

@maddox maddox closed this as completed Oct 31, 2017
@maddox maddox reopened this Oct 31, 2017
@librien
Copy link
Author

librien commented Oct 31, 2017

Thank you so much for the prompt response. I'm fine with adding a delay, I'm using python so I've added time.sleep(10) in between when the activity turns on and when I send the commands. I'll try to mess around with the time, maybe even a check for when the activity status changes. If that doesn't work I'll look at mosquito. Thanks again for the response!

@maddox maddox closed this as completed Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants