menu: directly return enable condition do not save in a variable

This commit is contained in:
alfrix 2024-04-04 11:30:08 -03:00
parent e34205a9cf
commit d21033ad55

View File

@ -83,8 +83,7 @@ class Panel(ScreenPanel):
return self._screen._ws.connected return self._screen._ws.connected
try: try:
j2_temp = Template(enable, autoescape=True) j2_temp = Template(enable, autoescape=True)
result = j2_temp.render(self.j2_data) return j2_temp.render(self.j2_data) == 'True'
return result == 'True'
except Exception as e: except Exception as e:
logging.debug(f"Error evaluating enable statement: {enable}\n{e}") logging.debug(f"Error evaluating enable statement: {enable}\n{e}")
return False return False