Skip to content

Commit 6798808

Browse files
committed
v1.6.0: fix ruff 0.15.0 linter issues (I001, FURB110)
1 parent dccedab commit 6798808

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

custom_components/home_maintenance/binary_sensor.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import logging
44

55
from homeassistant.components.binary_sensor import BinarySensorEntity
6-
7-
from .schedule import calculate_next_due
86
from homeassistant.config_entries import ConfigEntry
97
from homeassistant.core import HomeAssistant
108
from homeassistant.helpers import entity_registry as er
@@ -13,6 +11,7 @@
1311
from homeassistant.util import dt as dt_util
1412

1513
from . import const
14+
from .schedule import calculate_next_due
1615

1716
_LOGGER = logging.getLogger(__name__)
1817

@@ -94,9 +93,9 @@ def _update_state(self) -> None:
9493

9594
interval_value = self.task["interval_value"]
9695
interval_type = self.task["interval_type"]
97-
due_date = calculate_next_due(
98-
last, interval_value, interval_type
99-
).replace(hour=0, minute=0, second=0, microsecond=0)
96+
due_date = calculate_next_due(last, interval_value, interval_type).replace(
97+
hour=0, minute=0, second=0, microsecond=0
98+
)
10099

101100
self._attr_is_on = (
102101
dt_util.now().replace(hour=0, minute=0, second=0, microsecond=0) >= due_date

custom_components/home_maintenance/store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ def update_task(self, task_id: str, updated: dict) -> None:
164164

165165
if "tag_id" in updated:
166166
tag_id = updated["tag_id"]
167-
task.tag_id = tag_id if tag_id else None
168-
entity.task["tag_id"] = tag_id if tag_id else None
167+
task.tag_id = tag_id or None
168+
entity.task["tag_id"] = tag_id or None
169169

170170
if "labels" in updated:
171171
registry = entity_registry.async_get(self.hass)

0 commit comments

Comments
 (0)