-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
track entities referenced by states.* (#32)
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sensor.test1 | ||
entity_id: sensor.test2 | ||
entity_id : sensor.test3 | ||
entity_id:sensor.test4 | ||
'{{ not is_state(''sensor.test5'' | ||
'{{ not is_state("sensor.test6" | ||
state_attr('sensor.test7' | ||
- sensor.test8 | ||
# sensor.test9 | ||
states.sensor.test10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Test setup process.""" | ||
from copy import deepcopy | ||
from pytest_homeassistant_custom_component.common import MockConfigEntry | ||
from custom_components.watchman import ( | ||
async_setup_entry, | ||
) | ||
from custom_components.watchman.const import DOMAIN, CONF_INCLUDED_FOLDERS | ||
from custom_components.watchman.config_flow import DEFAULT_DATA | ||
|
||
TEST_INCLUDED_FOLDERS = ["/workspaces/thewatchman/tests/input_regex"] | ||
|
||
|
||
async def test_regex(hass): | ||
"""test missing entities detection""" | ||
options = deepcopy(DEFAULT_DATA) | ||
options[CONF_INCLUDED_FOLDERS] = TEST_INCLUDED_FOLDERS | ||
config_entry = MockConfigEntry( | ||
domain="watchman", data={}, options=options, entry_id="test" | ||
) | ||
assert await async_setup_entry(hass, config_entry) | ||
assert len(hass.data[DOMAIN]["entities_missing"]) == 9 |