Skip to content

Commit

Permalink
Fix Handy Wecker
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Oct 24, 2024
1 parent 22aeec5 commit e443d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ repos:
- id: ruff
name: ruff unused imports
# F401 [*] {name} imported but unused
args: [ "--select", "F401,I001", "--extend-exclude", "__init__.py", "--fix"]
args: [ "--select", "F401", "--extend-exclude", "__init__.py", "--fix"]

- id: ruff
# I001 [*] Import block is un-sorted or un-formatted
# UP035 [*] Import from {target} instead: {names}
# Q000 [*] Double quote found but single quotes preferred
# Q001 [*] Double quote multiline found but single quotes preferred
args: [ "--select", "UP035,Q000,Q001", "--fix"]
args: [ "--select", "I001,UP035,Q000,Q001", "--fix"]


- repo: https://github.com/JelleZijlstra/autotyping
Expand Down
4 changes: 2 additions & 2 deletions src/HABApp/rule/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __repr__(self) -> str:

return f'<{cls_name}{" ".join(parts)}>'

def post_event(self, name: BaseItem | str, event: Any):
def post_event(self, name: BaseItem | str, event: Any) -> None:
"""
Post an event to the event bus
Expand Down Expand Up @@ -142,7 +142,7 @@ def listen_event(self, name: BaseItem | str,
event_filter = HABApp.core.events.NoEventFilter()
if not isinstance(event_filter, EventFilterBase):
msg = f'Argument event_filter must be an instance of event filter (is {event_filter})'
raise ValueError(msg)
raise TypeError(msg)

listener = ContextBoundEventBusListener(name, cb, event_filter, parent_ctx=self._habapp_ctx)
return self._habapp_ctx.add_event_listener(listener)
Expand Down

0 comments on commit e443d07

Please sign in to comment.