mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Add attributes to fritz device_tracker (#30350)
* add attributes to device_tracker * fix pylint * requested changes * docstring updated
This commit is contained in:
parent
790b2d00c7
commit
99bc911f7f
@ -79,6 +79,14 @@ class FritzBoxScanner(DeviceScanner):
|
|||||||
return None
|
return None
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def get_extra_attributes(self, device):
|
||||||
|
"""Return the attributes (ip, mac) of the given device or None if is not known."""
|
||||||
|
ip_device = self.fritz_box.get_specific_host_entry(device).get("NewIPAddress")
|
||||||
|
|
||||||
|
if not ip_device:
|
||||||
|
return None
|
||||||
|
return {"ip": ip_device, "mac": device}
|
||||||
|
|
||||||
def _update_info(self):
|
def _update_info(self):
|
||||||
"""Retrieve latest information from the FRITZ!Box."""
|
"""Retrieve latest information from the FRITZ!Box."""
|
||||||
if not self.success_init:
|
if not self.success_init:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user