Error when using +=1 and -=1

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Error when using +=1 and -=1

Post by dlmorgan999 »

I have created a script device which I use to set the volume level of a zone in my AV distribution system serial device. The script device contains a Volume property which is a numeric property with a range of 0 to 40. I have property change buttons bound to this property that send +=1 and -=1.



The problem I have is that once the volume is at 40 you can continue to push the Volume Up button but HouseBot complains. It doesn't cause any problems but I'd just like to find an elegant way to handle this. Can anyone suggest a way to handle this or is this something I just shouldn't worry about?



-- Dave
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

What if you use a multi-state button. Have the default state just do the +=1. Have a state for "40" that just sets it to "40.
Scott
dlmorgan999
HouseBot Special Member
Posts: 409
Joined: Tue Jul 13, 2004 9:13 am
Location: Tigard, OR

Post by dlmorgan999 »

That sounds like it should solve the problem nicely. Thanks for the idea!
Post Reply