Skip to content

Commit

Permalink
fixed up linting
Browse files Browse the repository at this point in the history
  • Loading branch information
asosnovsky committed Sep 1, 2022
1 parent 774ebe4 commit 3aad35f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions api/src/automations/manager.py
Expand Up @@ -84,6 +84,8 @@ def create(self, automation: Automation):
)

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)
Expand Down Expand Up @@ -150,6 +152,8 @@ def delete_tags(self, automation_id: str):
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)
Expand Down
2 changes: 1 addition & 1 deletion api/tests/unittests/automations/test_loader.py
Expand Up @@ -10,7 +10,6 @@
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,
Expand All @@ -22,6 +21,7 @@
HA_CONFIG10_EXAMPLE,
HA_CONFIG11_EXAMPLE,
HA_CONFIG12_EXAMPLE,
HA_CONFIG13_EXAMPLE,
HA_CONFIG_EXAMPLE,
)

Expand Down

0 comments on commit 3aad35f

Please sign in to comment.