Skip to content

Commit fb9866c

Browse files
committed
Fix bugs
1 parent 1b07df6 commit fb9866c

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-ast
7+
- id: check-builtin-literals
8+
- id: check-case-conflict
9+
- id: check-docstring-first
10+
- id: check-executables-have-shebangs
11+
- id: check-json
12+
- id: check-shebang-scripts-are-executable
13+
- id: check-symlinks
14+
- id: check-toml
15+
- id: check-yaml
16+
- id: debug-statements
17+
- id: destroyed-symlinks
18+
- id: end-of-file-fixer
19+
- id: mixed-line-ending
20+
- id: requirements-txt-fixer
21+
- id: trailing-whitespace
22+
23+
- repo: https://github.com/astral-sh/ruff-pre-commit
24+
rev: v0.4.10
25+
hooks:
26+
- id: ruff
27+
args: [--fix]
28+
- id: ruff-format
29+
30+
- repo: https://github.com/pre-commit/mirrors-prettier
31+
rev: "v3.1.0"
32+
hooks:
33+
- id: prettier

custom_components/loe_outages/calendar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def event(self) -> CalendarEvent | None:
5353
now = dt_utils.now()
5454
LOGGER.debug("Getting current event for %s", now)
5555
interval = self.coordinator.get_event_at(now)
56+
if not interval:
57+
return None
58+
5659
return CalendarEvent(
5760
summary=interval.state,
5861
start=interval.startTime,

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
homeassistant==2024.7.0
22
pip>=21.0,<24.2
33
pre-commit>=3.7.1
4-
ruff==0.5.0
4+
ruff==0.5.0

scripts/develop

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ fi
1717
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components"
1818

1919
# Start Home Assistant
20-
hass --config "${PWD}/config" --debug
20+
hass --config "${PWD}/config" --debug

scripts/setup

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cd "$(dirname "$0")/.."
66

77
python3 -m pip install --requirement requirements.txt
88

9-
# pre-commit install
9+
pre-commit install

0 commit comments

Comments
 (0)