Skip to content

Commit 10080d2

Browse files
MyPy fixes (#3953)
1 parent c8cb1a3 commit 10080d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/battery_notes/binary_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def add_template_attribute(
429429
430430
"""
431431
assert self.hass is not None, "hass cannot be None"
432-
template.hass = self.hass
432+
tmpl.hass = self.hass
433433
template_attribute = _TemplateAttribute(
434434
self, attribute, tmpl, validator, on_update, none_on_template_error
435435
)

custom_components/battery_notes/coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def _link_to_source(self) -> bool: # noqa: PLR0912
296296
device_entry = device_registry.async_get(self.device_id)
297297
if device_entry:
298298
self.device_name = (
299-
self.subentry.title
299+
(self.subentry.title if self.subentry else None)
300300
or device_entry.name_by_user
301301
or device_entry.name
302302
)

0 commit comments

Comments
 (0)