Language

More
2 years 5 months ago #1162 by bowlingbeeg
Replied by bowlingbeeg on topic Language
One thing I've found over the years of programming other remotes is that it's usually best to always issue the proper commands. That way if things get out of sync for some reason, running through the power on flow will hopefully just fix things up. Otherwise you can run into trouble where one of the checks you're making prevents a command from running. For most things it won't hurt to send a command when it's already in that state(toggle commands can be an issue though). It just makes the code more bulletproof and it also makes it easier to read/understand.

Please Log in to join the conversation.

More
2 years 5 months ago #1163 by Sat32
Replied by Sat32 on topic Language
I agree planned to use power off as sort of a reset to a default postion

Please Log in to join the conversation.

More
2 years 5 months ago #1164 by Nillaz
Replied by Nillaz on topic Language

Here is the macro code I've been working on it's still work in beta and needs tweaking. But the basic idea is a harmony like activitys so when
I start a source it turns everything I need on and turn off what don't need and switches the inputs around only doing what is needed. I'm hoping to be able to copy and paste this into what ever scenes I want and then just edit the varables to match the activty

Code:
//Power Commands! //! //conditionaly turns on TV and Sets varable that the TV is on! if|IsNE##{{IR-SamsungTV_Power}}##OFF##SetVariable|IR-SamsungTVPower~ON!Control|2~SendIR~Samsung-Most Models~POWER ON! //conditionaly turns on av reciver if not on! if|IsNE##{{av_47_power}}##1##AV|47~Power~On! //conditionaly turns on av reciver! if|IsNE##{{av_49_power}}##off##AV|49~Power~On! //conditionaly turns on shield if not on! if|IsNE##{{IR-Xbox1_Power}}##OFF##SetVariable|IR-Xbox1_Power~OFF!2~SendIR~Microsoft-Xbox One~POWER OFF! // inputs commands! //! //conditionaly changes Tv input and sets varable! if|IsNE##{{IR-SamsungTV_Input}}##HDMI3##SetVariable|IR-SamsungTV_Input~HDMI3!Control|2~SendIR~Samsung-Most Models~INPUT HDMI 3! //conditionaly changes av reciever input! if|IsNE##{{av_47_input}}##AUX2##AV|47~Source~Aux2!




What do you guy think??
 
I think this approach makes sense. I've been using the brute force method to do this by just going into each of my "activities" and adding the proper commands for each device's power/input state. This works fine because I'm lucky enough that every device in my system has discrete on/off commands, but this method will fall apart for anyone who has a device that relies on a power toggle. Your way is better.

Eventually I'll get around to rewriting my macros to clean up all of the cruft in there and switch to conditional commands. I suspect that when I do so my structure is going to end up looking a lot like yours.

Please Log in to join the conversation.

More
2 years 5 months ago #1171 by Sat32
Replied by Sat32 on topic Language
couldn't find, but is there a way to
//waits for varable to be true before running command with timeout!
wait|{{varable}}##true#command|action!

//varable for must be true for an amount of time before action is taken!
for|{{time}}##{{varable}}##true##command|action!

thanks

Please Log in to join the conversation.

More
2 years 5 months ago #1176 by David Li
Replied by David Li on topic Language

couldn't find, but is there a way to
//waits for varable to be true before running command with timeout!
wait|{{varable}}##true#command|action!

//varable for must be true for an amount of time before action is taken!
for|{{time}}##{{varable}}##true##command|action!

thanks
Dave probably has a more eloquent solution, but that sure sounds like a myServer Automation Event.  Maybe you could lace that in.

Please Log in to join the conversation.

Time to create page: 0.198 seconds