Copy kwargs, remove traces.

This commit is contained in:
pavoni 2016-01-29 16:12:34 +00:00
parent a3abd8bb08
commit c5cdf6d7cf

View File

@ -52,8 +52,6 @@ def setup_scanner(hass, config, see):
# Block updates if we're in a region # Block updates if we're in a region
with LOCK: with LOCK:
_LOGGER.error("REGIONS_ENTERED %s",REGIONS_ENTERED)
_LOGGER.error("MOBILE_BEACONS_ACTIVE %s",MOBILE_BEACONS_ACTIVE)
if REGIONS_ENTERED[dev_id]: if REGIONS_ENTERED[dev_id]:
_LOGGER.debug( _LOGGER.debug(
"location update ignored - inside region %s", "location update ignored - inside region %s",
@ -77,10 +75,6 @@ def setup_scanner(hass, config, see):
'Unable to parse payload as JSON: %s', payload) 'Unable to parse payload as JSON: %s', payload)
return return
_LOGGER.error("REGIONS_ENTERED %s",REGIONS_ENTERED)
_LOGGER.error("MOBILE_BEACONS_ACTIVE %s",MOBILE_BEACONS_ACTIVE)
if not isinstance(data, dict) or data.get('_type') != 'transition': if not isinstance(data, dict) or data.get('_type') != 'transition':
return return
@ -141,9 +135,10 @@ def setup_scanner(hass, config, see):
data['event']) data['event'])
return return
def see_beacons(dev_id, kwargs): def see_beacons(dev_id, kwargs_param):
""" Set active beacons to the current location """ """ Set active beacons to the current location """
kwargs = kwargs_param.copy()
for beacon in MOBILE_BEACONS_ACTIVE[dev_id]: for beacon in MOBILE_BEACONS_ACTIVE[dev_id]:
kwargs['dev_id'] = "{}_{}".format(BEACON_DEV_ID, beacon) kwargs['dev_id'] = "{}_{}".format(BEACON_DEV_ID, beacon)
kwargs['host_name'] = beacon kwargs['host_name'] = beacon