travisghansen / hass-opnsense

OPNsense integration with Home Assistant
Apache License 2.0
229 stars 29 forks source link

[Bug]: Device Tracker Consider Home value cause an exception #252

Closed ericgu08 closed 1 month ago

ericgu08 commented 1 month ago

What happened?

When the parameter is set to a value different than 0, an error is reported in home assistant. Also the device tracker never return to away when off the network.

Thanks and keep up the good work!

hass-opnsense Version

0.3.4

OPNsense Firmware

24.7.5_3

Home Assistant Version

2024.10.1

Relevant logs

Error from debug log:

File "/config/custom_components/opnsense/device_tracker.py", line 232, in _handle_coordinator_update
    elapsed = current_time - self._last_known_connected_time
              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'datetime.datetime'

Additional Details

No response