def result_as_boolean(template_result: (str | None)) -> bool:
    "Convert the template result to a boolean.\n\n    True/not 0/'1'/'true'/'yes'/'on'/'enable' are considered truthy\n    False/0/None/'0'/'false'/'no'/'off'/'disable' are considered falsy\n\n    "
    try:
        from homeassistant.helpers import config_validation as cv
        return cv.boolean(template_result)
    except vol.Invalid:
        return False
Convert the template result to a boolean.

True/not 0/'1'/'true'/'yes'/'on'/'enable' are considered truthy
False/0/None/'0'/'false'/'no'/'off'/'disable' are considered falsy
def result_as_boolean(template_result: (str | None)) -> bool:
    "Convert the template result to a boolean.\n\n    True/not 0/'1'/'true'/'yes'/'on'/'enable' are considered truthy\n    False/0/None/'0'/'false'/'no'/'off'/'disable' are considered falsy\n\n    "
    try:
        from homeassistant.helpers import config_validation as cv
        return cv.boolean(template_result)
    except vol.Invalid:
        return False