partial support

This commit is contained in:
ari committed 2022-08-27 13:58:41 -04:00
1 parent 30a6f2ca6e
commit 80bfbdab80
21 files changed
+52 -213

No files matched your search

@@ -1,23 +0,0 @@
- id: "base1"
alias: BASE
description: Example
mode: single
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.up_times
- id: "base2"
alias: base 2
description: ""
trigger:
- platform: sun
event: sunrise
offset: 0
condition: []
action: []
mode: single
@@ -1,14 +0,0 @@
id: "1659114822642"
alias: On Home Down
description: Example
mode: single
trigger:
- platform: homeassistant
event: shutdown
condition: []
action:
- service: counter.increment
target:
entity_id:
- counter.up_times
data: {}
@@ -1,13 +0,0 @@
id: "1659114647066"
alias: HA Up
description: Example
mode: single
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.up_times
@@ -1,13 +0,0 @@
id: "1659114647067"
alias: Notify Washer
description: Example
mode: single
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.up_times
@@ -1,7 +0,0 @@
- id: "mlist1"
alias: Merged List 1
description: ""
trigger: []
condition: []
action: []
mode: single
@@ -1,14 +0,0 @@
- id: "mlist2"
alias: Merged List 2
description: ""
trigger: []
condition: []
action: []
mode: single
- id: "mlist3"
alias: Merged List 3
description: ""
trigger: []
condition: []
action: []
mode: single
@@ -1,14 +0,0 @@
- id: "sublist3-mlist2"
alias: Sublist 3 - Merged List 2
description: ""
trigger: []
condition: []
action: []
mode: single
- id: "sublist3-mlist3"
alias: Sublist 3 - Merged List 3
description: ""
trigger: []
condition: []
action: []
mode: single
@@ -1,6 +1,6 @@
package2:
automation:
- id: "package-ha"
- id: "package2"
alias: package ha
description: Example package auto
mode: single
@@ -1,23 +0,0 @@
- id: "base1"
alias: BASE
description: Example
mode: single
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.up_times
- id: "base2"
alias: base 2
description: ""
trigger:
- platform: sun
event: sunrise
offset: 0
condition: []
action: []
mode: single
@@ -1,14 +0,0 @@
id: "1659114822642"
alias: On Home Down
description: Example
mode: single
trigger:
- platform: homeassistant
event: shutdown
condition: []
action:
- service: counter.increment
target:
entity_id:
- counter.up_times
data: {}
@@ -1,13 +0,0 @@
id: "1659114647066"
alias: HA Up
description: Example
mode: single
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.up_times
@@ -1,13 +0,0 @@
id: "1659114647067"
alias: Notify Washer
description: Example
mode: single
trigger:
- platform: homeassistant
event: start
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.up_times
@@ -1,7 +0,0 @@
- id: "mlist1"
alias: Merged List 1
description: ""
trigger: []
condition: []
action: []
mode: single
@@ -1,14 +0,0 @@
- id: "mlist2"
alias: Merged List 2
description: ""
trigger: []
condition: []
action: []
mode: single
- id: "mlist3"
alias: Merged List 3
description: ""
trigger: []
condition: []
action: []
mode: single
@@ -1,14 +0,0 @@
- id: "sublist3-mlist2"
alias: Sublist 3 - Merged List 2
description: ""
trigger: []
condition: []
action: []
mode: single
- id: "sublist3-mlist3"
alias: Sublist 3 - Merged List 3
description: ""
trigger: []
condition: []
action: []
mode: single
@@ -1,5 +1,5 @@
automation:
- id: "package-ha"
- id: "package-sub"
alias: package ha
description: Example package auto
mode: single
@@ -10,11 +10,14 @@ from src.automations.tags import TagManager
from src.automations.types import ExtenededAutomation
from src.hass_config.loader import HassConfig
from tests.utils import (
HA_CONFIG10_EXAMPLE,
HA_CONFIG2_EXAMPLE,
HA_CONFIG3_EXAMPLE,
HA_CONFIG4_EXAMPLE,
HA_CONFIG5_EXAMPLE,
HA_CONFIG6_EXAMPLE,
HA_CONFIG7_EXAMPLE,
HA_CONFIG8_EXAMPLE,
HA_CONFIG9_EXAMPLE,
HA_CONFIG_EXAMPLE,
)
@@ -149,9 +152,12 @@ class loader_tests(TestCase):
(HA_CONFIG4_EXAMPLE, 1),
(HA_CONFIG5_EXAMPLE, 3),
(HA_CONFIG6_EXAMPLE, 4),
(HA_CONFIG7_EXAMPLE, 1),
(HA_CONFIG8_EXAMPLE, 1),
(HA_CONFIG9_EXAMPLE, 1),
(HA_CONFIG10_EXAMPLE, 1),
]:
with self.subTest(ha_path=ha_path, expected=expected):
with self.subTest(config_name=ha_path.name, expected=expected):
hass_config = HassConfig(ha_path)
paths = list(extract_automation_paths(hass_config))
self.assertEqual(len(paths), expected)
@@ -12,6 +12,7 @@ from src.errors import ErrorSet
from src.hass_config.loader import HassConfig
from tests.utils import (
HA_CONFIG6_EXAMPLE,
HA_CONFIG8_EXAMPLE,
HA_CONFIG_EXAMPLE,
create_copy_of_example_config,
)
@@ -327,3 +328,9 @@ class manager_tests(TestWithDB):
auto.tags,
{},
)
def test_load_pacakges(self):
_, automation_manager = self.get_manager(HA_CONFIG8_EXAMPLE)
automation_manager.reload()
auto = automation_manager.get("package-sub")
self.assertEqual(auto.configuration_key, "pacakage2")
+1
View File
@@ -19,6 +19,7 @@ HA_CONFIG6_EXAMPLE = SAMPLES_FOLDER / "config-6"
HA_CONFIG7_EXAMPLE = SAMPLES_FOLDER / "config-7"
HA_CONFIG8_EXAMPLE = SAMPLES_FOLDER / "config-8"
HA_CONFIG9_EXAMPLE = SAMPLES_FOLDER / "config-9"
HA_CONFIG10_EXAMPLE = SAMPLES_FOLDER / "config-10"
def get_example_automation_loader(