how does this work?

More
2 years 4 months ago #1870 by Sat32
how does this work? was created by Sat32
Installed the the new master image for pi and noticed the volume macro's changed?
instead of a roomname volume up and a roomname volume down we simply have a roomname volume.

the code on that is:
Code:
Macro| // The macro is responsible for controlling volume in a room! AV|{{livingroom_avamp_id}}~Volume~<p1>~3!
The <p1> I assume is some sort of variable, but from where and how do we use it? is there a <p2> or <p3>

Thanks
 

Please Log in to join the conversation.

More
2 years 4 months ago #1873 by davep
Replied by davep on topic how does this work?
We want to try to reduce the number of macros being created but wasn't expecting someone to reflash a new server so soon. Instead of VolumeUp, VolumeDown, PowerOn, PowerOff it's better to have just one Volume and Power macro and pass in the options as needed.

Volume.room|up   or Volume.room|up~3 (up 3 steps)  Volume.room|down   or Volume.room|down~3 (down 3 steps) 
VolumeMute.room|on  or VolumeMute.room|off  or VolumeMute.room|toggle
Power.room|on  or Power.room|off  or Power.room|toggle

The updated smartremote, moonlight tablet and phone templates will be calling these macros.

This should not break anything for existing installs using the old macro naming conventions as the server will compensate. Since you are a little ahead of the curve modify your project hard button commands to use the new macro naming conventions.

 

Please Log in to join the conversation.

More
2 years 4 months ago - 2 years 4 months ago #1875 by Sat32
Replied by Sat32 on topic how does this work?
so if I mapped this command to a button on remote
LaunchApp.{{activeroom_{{clientname}}}}|Netflix

and created a macro named livingroom.LaunchApp
with this code
AV|{{livingroom_shieldtv_id}}~Launch~<p1>!
in it

Would it Work?

 
Last edit: 2 years 4 months ago by Sat32.

Please Log in to join the conversation.

More
2 years 4 months ago #1876 by cjisble
Replied by cjisble on topic how does this work?

We want to try to reduce the number of macros being created but wasn't expecting someone to reflash a new server so soon. Instead of VolumeUp, VolumeDown, PowerOn, PowerOff it's better to have just one Volume and Power macro and pass in the options as needed.

 
This works for volume, but only works for power if you assume the intent is to power on or power off everything in the room.

I have the power on macro for the room set to turn on the TV and the Receiver only.   Different source devices get their power on command if/when activated.  Power off turns off everything.

I know that I can still make it work if there is a single macro, but I will need to add conditional statements.  It is cleaner to use two macros.
 

Please Log in to join the conversation.

More
2 years 4 months ago #1877 by Sat32
Replied by Sat32 on topic how does this work?

This works for volume, but only works for power if you assume the intent is to power on or power off everything in the room.
I have the power on macro for the room set to turn on the TV and the Receiver only.   Different source devices get their power on command if/when activated.  Power off turns off everything.

I know that I can still make it work if there is a single macro, but I will need to add conditional statements.  It is cleaner to use two macros.
 

I haven't done any testing on this but could the <p1> be used in a if command follow the example I used

if|IsEQ##<p1>##Netflix##av|id~command!

if that works could add a lot of possibilitys

Thanks

Please Log in to join the conversation.

More
2 years 4 months ago #1878 by Sat32
Replied by Sat32 on topic how does this work?
And what if?
power.{{activeroom_{{clientname}}}}|on
could be done like
power.{{activeroom_{{clientname}}}}|on~Hdmi2~Dolby

then in macro
<p1> = on
<p2> = hdmi2
<p3> = Dolby

Then options for a could be set with one line

Please Log in to join the conversation.

Time to create page: 0.176 seconds