FortiOS device_tracker


#21

Great.
So it works until 5.6 at least.
I’ll try to run it against 6.0 sometime…


#22

upgraded to 88.2
Seems like the FortiOS device tracker doesn’t work anymore.
Logs told me to change directories, so now I have custom_components/fortiOS/device_trackery.py

Now in logs I get this error.

Log Details (ERROR)
Sun Mar 03 2019 19:11:55 GMT-0600 (CST)

Error setting up platform fortiOS
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/device_tracker/__init__.py", line 177, in async_setup_platform
    platform.get_scanner, hass, {DOMAIN: p_config})
  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/fortiOS/device_tracker.py", line 32, in get_scanner
    scanner = FortiDeviceScanner(config[DOMAIN])
  File "/config/custom_components/fortiOS/device_tracker.py", line 50, in __init__
    self.success_init = self._update_info()
  File "/config/custom_components/fortiOS/device_tracker.py", line 70, in _update_info
    string_result = self._get_arp_data()
  File "/config/custom_components/fortiOS/device_tracker.py", line 104, in _get_arp_data
    from pexpect import pxssh
  File "/config/deps/lib/python3.7/site-packages/pexpect/__init__.py", line 75, in <module>
    from .pty_spawn import spawn, spawnu
  File "/config/deps/lib/python3.7/site-packages/pexpect/pty_spawn.py", line 15, in <module>
    from .spawnbase import SpawnBase
  File "/config/deps/lib/python3.7/site-packages/pexpect/spawnbase.py", line 218
    def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
                                                                   ^
SyntaxError: invalid syntax

Thoughts?


#23

Any ideas? If not, I guess I will try another tracking system.


#24

I didn’t have the time to look at the upgrade, but I saw that 88 was likely to break a lot of things. This component (which I rely on exclusively for device tracking), my central heater component too. So I decided to wait a bit before upgrading.

You have handled the first modification needed, move the custom component to the right directory. Have you created an empty __init__.py there ?

Next step will be to understand what has changed in the registration of the tracker. I’ll try to look at it (so break my system and upgrade !) next week. I run on VMWare so I can do a snapshot and restore if things go really bad !