Custom Component - Juniper

I created a simple device tracker that scans the ARP-table of a Juniper router (switch or firewall) and tracks mac addresses of interesting devices.

Juniper Device Tracker

Hi Olen,

I’ve just tried using your device tracker for SRX and it doesn’t seem to work.

2020-02-29 15:25:10 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 163, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 495, in async_scan_devices
    return await self.hass.async_add_job(self.scan_devices)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/juniper/device_tracker.py", line 80, in scan_devices
    for entry in self.last_results['arp-table-information'][0]['arp-table-entry']:
  File "src/lxml/etree.pyx", line 1159, in lxml.etree._Element.__getitem__
TypeError: 'str' object cannot be interpreted as an integer