Cast acc to float before comparison.
parent
37b6aa593e
commit
c7e49f20d3
|
@ -11,6 +11,7 @@ from collections import defaultdict
|
||||||
|
|
||||||
import homeassistant.components.mqtt as mqtt
|
import homeassistant.components.mqtt as mqtt
|
||||||
from homeassistant.const import STATE_HOME
|
from homeassistant.const import STATE_HOME
|
||||||
|
from homeassistant.util import convert
|
||||||
|
|
||||||
DEPENDENCIES = ['mqtt']
|
DEPENDENCIES = ['mqtt']
|
||||||
|
|
||||||
|
@ -46,8 +47,8 @@ def setup_scanner(hass, config, see):
|
||||||
return
|
return
|
||||||
|
|
||||||
if (not isinstance(data, dict) or data.get('_type') != 'location') or (
|
if (not isinstance(data, dict) or data.get('_type') != 'location') or (
|
||||||
'acc' in data and max_gps_accuracy is not None and data[
|
max_gps_accuracy is not None and
|
||||||
'acc'] > max_gps_accuracy):
|
convert(data.get('acc'), float, 0.0) > max_gps_accuracy):
|
||||||
return
|
return
|
||||||
|
|
||||||
dev_id, kwargs = _parse_see_args(topic, data)
|
dev_id, kwargs = _parse_see_args(topic, data)
|
||||||
|
|
Loading…
Reference in New Issue