is that possible?
having multiple contrain_input_boolean on a app?
Or possible calling a app to check if configured inputboleans i set og return a true or false, and then using this app in other apps?
is that possible?
having multiple contrain_input_boolean on a app?
Or possible calling a app to check if configured inputboleans i set og return a true or false, and then using this app in other apps?
I couldn’t create multiple input_boolean constraints, so I used one input_boolean and one input_select with two items.
yeah, i could get to work either.
so i wrote a app to validate the diffrent states off the inputs.
import appdaemon.appapi as appapi
class Validator(appapi.AppDaemon):
def initialize(self):
self.log("Validator initialize")
self.handle = None
def CheckBooleans(self, input_booleans):
check = True
for input_boolean in input_booleans :
boolean = input_boolean.split(',')
if not ( self.get_state(boolean[0]) == boolean[1] ):
check = False
return check
and used in another app remeber to put in the configuration
validator = self.get_app("validator")
if validator.CheckBooleans( self.args["input_booleans"] ):