Skip to content

Commit

Permalink
* device_notifications.py: Address Sonar concerns re: condition to …
Browse files Browse the repository at this point in the history
…disallow empty device ID
  • Loading branch information
hostcc committed Dec 16, 2024
1 parent 705bb4c commit f6b6538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyg90alarm/device_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def device_id(self) -> Optional[str]:
def device_id(self, device_id: str) -> None:
# Under not yet identified circumstances the device ID might be empty
# string provided by :meth:`G90Alarm.get_host_info` - disallow that
if not device_id or not len(device_id.strip()) != 0:
if not device_id or len(device_id.strip()) == 0:
_LOGGER.debug(
'Device ID is empty or contains whitespace only, not setting'
)
Expand Down

0 comments on commit f6b6538

Please sign in to comment.