Skip to content

Commit

Permalink
Tidied the logging for device errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
UpDryTwist committed Oct 28, 2023
1 parent 956eb41 commit 5f822be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/dchs150_motion/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ def device_name(self) -> str:
@property
def full_device_name(self) -> str:
"""Long name including IP"""
return f"{self._client.device_name}: {self._client.mac_address} at {self._client.url_address}"
device_name = (
f"{self._client.device_name}: " if self._client.device_name else ""
)
mac_address = (
f"{self._client.mac_address} at " if self._client.mac_address else ""
)
return f"{device_name}{mac_address}{self._client.url_address}"

@property
def detection_type(self) -> str:
Expand Down

0 comments on commit 5f822be

Please sign in to comment.