Skip to content

Commit 363bc8f

Browse files
committed
Fixed wrong device entity names when no dns was returned
1 parent 0dc9c5d commit 363bc8f

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Changelog
22

3-
### 2.0.9
3+
### 2.1.3
44

55
- Added **Enable Found Devices** option to enable/disable all device tracker entities
66
- Added **Track New Devices** option to control auto-creation of entities for newly discovered devices

custom_components/arpscan_tracker/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"scapy>=2.5.0",
1414
"ouilookup>=0.2.4"
1515
],
16-
"version": "2.1.3"
16+
"version": "2.1.4"
1717
}

custom_components/arpscan_tracker/scanner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ def _lookup_hostname(self, ip: str) -> str | None:
193193
return None
194194

195195
return short_name
196+
197+
# Reject hostnames that are just numbers (partial IPs like "192")
198+
if hostname.isdigit():
199+
return None
200+
196201
return hostname
197202
except (socket.herror, socket.gaierror, OSError):
198203
# No reverse DNS entry

0 commit comments

Comments
 (0)