def METHOD_NAME(self, data):
    self.state = data
    if data and self.flash:
        self.setFlashing(True)
    elif data and not self.flash:
        self.setState(True)
    else:
        self.setFlashing(False)
        self.setState(False)