Skip to content

Commit

Permalink
fixed bug with unavailable state which was not properly ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
dummylabs committed Feb 11, 2022
1 parent c6e7626 commit fdfbe58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/watchman/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"documentation": "https://github.com/dummylabs/thewatchman",
"issue_tracker": "https://github.com/dummylabs/thewatchman/issues",
"iot_class": "local_push",
"version": "0.3.0",
"version": "0.3.1",
"requirements": ["prettytable==3.0.0"],
"codeowners": [
"@dummylabs"
Expand Down
5 changes: 4 additions & 1 deletion custom_components/watchman/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ def check_services(hass, config):

def check_entitites(hass, config):
"""check if entries from config file are entities with an active state"""
ignored_states = config[DOMAIN].get(CONF_IGNORED_STATES, [])
ignored_states = [
"unavail" if s == "unavailable" else s
for s in config[DOMAIN].get(CONF_IGNORED_STATES, [])
]
ignored_items = config[DOMAIN].get(CONF_IGNORED_ITEMS, [])
ignored_items = list(set(ignored_items + BUNDLED_IGNORED_ITEMS))
if DOMAIN not in hass.data or "entity_list" not in hass.data[DOMAIN]:
Expand Down

0 comments on commit fdfbe58

Please sign in to comment.