mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Tidy warnings.
This commit is contained in:
parent
a7703f27d8
commit
41dad9a8f7
@ -54,14 +54,14 @@ def setup_scanner(hass, config, see):
|
|||||||
return data
|
return data
|
||||||
if max_gps_accuracy is not None and \
|
if max_gps_accuracy is not None and \
|
||||||
convert(data.get('acc'), float, 0.0) > max_gps_accuracy:
|
convert(data.get('acc'), float, 0.0) > max_gps_accuracy:
|
||||||
_LOGGER.debug('Skipping %s update because expected GPS '
|
_LOGGER.warning('Ignoring %s update because expected GPS '
|
||||||
'accuracy %s is not met: %s',
|
'accuracy %s is not met: %s',
|
||||||
data_type, max_gps_accuracy, data)
|
data_type, max_gps_accuracy, payload)
|
||||||
return None
|
return None
|
||||||
if convert(data.get('acc'), float, 1.0) == 0.0:
|
if convert(data.get('acc'), float, 1.0) == 0.0:
|
||||||
_LOGGER.debug('Skipping %s update because GPS accuracy'
|
_LOGGER.warning('Ignoring %s update because GPS accuracy'
|
||||||
'is zero',
|
'is zero: %s',
|
||||||
data_type)
|
data_type, payload)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return data
|
return data
|
||||||
@ -152,17 +152,20 @@ def setup_scanner(hass, config, see):
|
|||||||
if 'acc' in data:
|
if 'acc' in data:
|
||||||
if data['acc'] == 0.0:
|
if data['acc'] == 0.0:
|
||||||
valid_gps = False
|
valid_gps = False
|
||||||
_LOGGER.info("Zero GPS reported")
|
_LOGGER.warning(
|
||||||
|
'Ignoring GPS in region exit because accuracy'
|
||||||
|
'is zero: %s',
|
||||||
|
payload)
|
||||||
if (max_gps_accuracy is not None and
|
if (max_gps_accuracy is not None and
|
||||||
data['acc'] > max_gps_accuracy):
|
data['acc'] > max_gps_accuracy):
|
||||||
valid_gps = False
|
valid_gps = False
|
||||||
_LOGGER.info("Inaccurate GPS reported")
|
_LOGGER.warning(
|
||||||
|
'Ignoring GPS in region exit because expected '
|
||||||
|
'GPS accuracy %s is not met: %s',
|
||||||
|
max_gps_accuracy, payload)
|
||||||
if valid_gps:
|
if valid_gps:
|
||||||
see(**kwargs)
|
see(**kwargs)
|
||||||
see_beacons(dev_id, kwargs)
|
see_beacons(dev_id, kwargs)
|
||||||
else:
|
|
||||||
_LOGGER.info("Inaccurate GPS reported")
|
|
||||||
|
|
||||||
beacons = MOBILE_BEACONS_ACTIVE[dev_id]
|
beacons = MOBILE_BEACONS_ACTIVE[dev_id]
|
||||||
if location in beacons:
|
if location in beacons:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user