Problem with automation AC off When window is close

I have recently updated my Blueprint for Home Assistant climate entities. Although this topic has been solved, I would like to introduce you to the method I have used. Check out the code: