fixed up linting

This commit is contained in:
ari committed 2022-09-01 17:25:56 -04:00
1 parent 774ebe482a
commit 3aad35fbce
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -84,6 +84,8 @@ class AutomationManager:
)
def update(self, automation: ExtenededAutomation, create_if_not_found: bool = False):
if automation.id is None:
raise AssertionError("automation.id must be defined to update!")
automation_path = self.hass_config.root_path / automation.source_file
if not automation_path.parent.exists():
automation_path.parent.mkdir(parents=True)
@@ -150,6 +152,8 @@ class AutomationManager:
self.tag_manager.save(self.tag_path)
def delete(self, automation: ExtenededAutomation):
if automation.id is None:
raise AssertionError("automation.id must be defined to update!")
automation_path = self.hass_config.root_path / automation.source_file
if automation.source_file_type == "obj":
automation_path.unlink(missing_ok=True)
@@ -10,7 +10,6 @@ from src.automations.tags import TagManager
from src.automations.types import ExtenededAutomation
from src.hass_config.loader import HassConfig
from tests.utils import (
HA_CONFIG13_EXAMPLE,
HA_CONFIG2_EXAMPLE,
HA_CONFIG3_EXAMPLE,
HA_CONFIG4_EXAMPLE,
@@ -22,6 +21,7 @@ from tests.utils import (
HA_CONFIG10_EXAMPLE,
HA_CONFIG11_EXAMPLE,
HA_CONFIG12_EXAMPLE,
HA_CONFIG13_EXAMPLE,
HA_CONFIG_EXAMPLE,
)