Blocks: Condition on device state and Condition on multiple states

Hello,

I propose new blocks.

The first one, « Condition on device state, » allows you to test the state of a device without retrieving its value and testing that value, which is often completely unknown.

Indeed, the trigger is on an action and not on a number.

Here’s what it looks like:

The code: Comparing GladysAssistant:master...Hizoka76:feat/add_state_condition · GladysAssistant/Gladys · GitHub

The second proposal can replace the first one as it does the same thing but with a multiple selection of states:

And its trigger version:

Code: Comparing GladysAssistant:master...Hizoka76:feat/device_multi_state_change · GladysAssistant/Gladys · GitHub

To test, I created a container that contains all my ideas: Package gladys · GitHub

2 Likes

@Hizo I really like it!
And it matches my requests from a few months ago:

I need to take some time to test your container.