device: fix bug in hidpp20 get host names

This commit is contained in:
Peter F. Patel-Schneider 2024-02-21 16:01:42 -05:00
parent af7806ed00
commit 68b62a9ee4
1 changed files with 5 additions and 5 deletions

View File

@ -1764,11 +1764,11 @@ def get_host_names(device):
else:
remaining = 0
host_names[host] = (bool(status), name)
# update the current host's name if it doesn't match the system name
hostname = socket.gethostname().partition(".")[0]
if host_names[currentHost][1] != hostname:
set_host_name(device, hostname, host_names[currentHost][1])
host_names[currentHost] = (host_names[currentHost][0], hostname)
if host_names: # update the current host's name if it doesn't match the system name
hostname = socket.gethostname().partition(".")[0]
if host_names[currentHost][1] != hostname:
set_host_name(device, hostname, host_names[currentHost][1])
host_names[currentHost] = (host_names[currentHost][0], hostname)
return host_names