Fix for sensor type attr

This commit is contained in:
Ivan Pavlina 2020-04-08 14:14:09 +02:00
parent 32b93cc8cc
commit e8d2efe956

View file

@ -383,7 +383,7 @@ class MikrotikAccountingSensor(MikrotikControllerSensor):
"""Return if controller and accounting feature in Mikrotik is available.
Additional check for lan-tx/rx sensors
"""
if self._sensor in ['lan-tx, lan-rx']:
if self._attr in ['lan-tx, lan-rx']:
return self._ctrl.connected() and self._data['available'] and self._data['local_accounting']
else:
return self._ctrl.connected() and self._data['available']