def METHOD_NAME(self, **kwargs):
    for block in self.blocks:
        if block.get_state() == self.state:
            block.selected = True
        else:
            block.selected = False
    self.viewport().update()