Skip to content

Commit cca0ede

Browse files
Rename _link_device to _link_to_source for clarity in device linking logic
1 parent 29f1989 commit cca0ede

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

custom_components/battery_notes/coordinator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(
130130
self.device_id = config_entry.data.get(CONF_DEVICE_ID, None)
131131
self.source_entity_id = config_entry.data.get(CONF_SOURCE_ENTITY_ID, None)
132132

133-
if not self._link_device():
133+
if not self._link_to_source():
134134
self.is_orphaned = True
135135
return
136136

@@ -201,8 +201,8 @@ def __init__(
201201
)
202202
self.last_reported = last_reported
203203

204-
def _link_device(self) -> bool:
205-
"""Get the device name."""
204+
def _link_to_source(self) -> bool:
205+
"""Get the source device or entity, determine name and associate our wrapped battery if available."""
206206
device_registry = dr.async_get(self.hass)
207207
entity_registry = er.async_get(self.hass)
208208

0 commit comments

Comments
 (0)