mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Only mark active DHCP clients as present (#8110)
We only want to know which of the DHCP clients are indeed active. For example: I've a table of static DHCP leases with most of the IPs of my network, so this module is always detecting them as present. With my patch only the active ones will be detected as present. I already mentioned here: https://github.com/home-assistant/home-assistant/pull/7366#issuecomment-302950139
This commit is contained in:
parent
1928da1fae
commit
04920fa0bf
@ -158,6 +158,11 @@ class MikrotikScanner(DeviceScanner):
|
||||
for device in devices
|
||||
}
|
||||
else:
|
||||
self.last_results = mac_names
|
||||
self.last_results = {
|
||||
device.get('mac-address'):
|
||||
mac_names.get(device.get('mac-address'))
|
||||
for device in device_names
|
||||
if device.get('active-address')
|
||||
}
|
||||
|
||||
return True
|
||||
|
Loading…
x
Reference in New Issue
Block a user