<commit_before>""" Close a cover only if it is open """

entities = data.get("entity_id")
for entity_id in entities:
    state = hass.states.get(entity_id)

    if state == "open":
        logger.info("Closing " + str(entity_id))
        hass.services.call("cover", "close", { "entity_id": entity_id })
    else:
        logger.info("Not closing " + str(entity_id) + " since it was already closed")<commit_msg>Update close_if_open.py<commit_after>""" Close a cover only if it is open """

entities = data.get("entity_id")
for entity_id in entities:
    state = hass.states.get(entity_id)

    if state.state == "open":
        logger.info("Closing " + str(entity_id))
        hass.services.call("cover", "close", { "entity_id": entity_id })
    else:
        logger.info("Not closing " + str(entity_id) + " since it was " + state.state)
{'fraction_non_alphanumeric': 0.1507177033492823, 'fraction_numerical': 0.0, 'mean_word_length': 3.452127659574468, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3690183', 'n_tokens_mistral': 269, 'n_tokens_neox': 270, 'n_words': 69}