# H.O.O.P. (Hope) - Homey Object Oriented Programming

**URL:** <https://community.homey.app/t/h-o-o-p-hope-homey-object-oriented-programming/43709>\
**Category:** Apps\
**Tags:** app, tools, flow\
**Created:** [March 4, 2021, 6:22pm UTC](https://community.homey.app/t/h-o-o-p-hope-homey-object-oriented-programming/43709 "2021-03-04T18:22:00Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [March 28, 2021, 2:43pm UTC](https://community.homey.app/t/h-o-o-p-hope-homey-object-oriented-programming/43709/14 "2021-03-28T14:43:34Z")

</div>

> [@H.O.O.P. (Hope) - Examples](https://community.homey.app/t/h-o-o-p-hope-examples/45114/12):
>
> IF “PushButtonPushesCount” = 2  
> THEN (Set light 50%)
> 
> IF “PushButtonPushesCount” = 3  
> THEN (Set light 100%)

Nice too see!  
You can even easily add dim steps, or other actions with a certain no. of pushes.  
I realized f.i. my table lights have 3 favorite dim values: 20%, 50% and 100%  
So an extra step is simple to add:  
IF “PushButtonPushesCount” = 2  
THEN (Set light 20%)

IF “PushButtonPushesCount” = 3  
THEN (Set light 50%)

IF “PushButtonPushesCount” = 4  
THEN (Set light 100%)

I like it!

I made this 3-step-dim-and-off function earlier on with standard flows, and it took me 7 flows. Yes… seven!  
 ![eettafel_dimstappen_flows](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/9/19e2f0fe9352418ca0638eeb0694d615f2b5d49c.png)

---

_[View the full topic](https://community.homey.app/t/h-o-o-p-hope-homey-object-oriented-programming/43709)._
