mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fixed flake8 style errors
This commit is contained in:
parent
82904c59ce
commit
d244d3b599
@ -1,6 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.device_tracker.owntracks
|
homeassistant.components.device_tracker.owntracks
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
OwnTracks platform for the device tracker.
|
OwnTracks platform for the device tracker.
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
@ -18,6 +18,7 @@ CONF_TRANSITION_EVENTS = 'use_events'
|
|||||||
LOCATION_TOPIC = 'owntracks/+/+'
|
LOCATION_TOPIC = 'owntracks/+/+'
|
||||||
EVENT_TOPIC = 'owntracks/+/+/event'
|
EVENT_TOPIC = 'owntracks/+/+/event'
|
||||||
|
|
||||||
|
|
||||||
def setup_scanner(hass, config, see):
|
def setup_scanner(hass, config, see):
|
||||||
""" Set up an OwnTracks tracker. """
|
""" Set up an OwnTracks tracker. """
|
||||||
|
|
||||||
@ -50,7 +51,6 @@ def setup_scanner(hass, config, see):
|
|||||||
|
|
||||||
see(**kwargs)
|
see(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
def owntracks_event_update(topic, payload, qos):
|
def owntracks_event_update(topic, payload, qos):
|
||||||
""" MQTT event (geofences) received. """
|
""" MQTT event (geofences) received. """
|
||||||
|
|
||||||
@ -67,7 +67,6 @@ def setup_scanner(hass, config, see):
|
|||||||
if not isinstance(data, dict) or data.get('_type') != 'transition':
|
if not isinstance(data, dict) or data.get('_type') != 'transition':
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# check if in "home" fence or other zone
|
# check if in "home" fence or other zone
|
||||||
location = ''
|
location = ''
|
||||||
if data['event'] == 'enter':
|
if data['event'] == 'enter':
|
||||||
@ -80,7 +79,8 @@ def setup_scanner(hass, config, see):
|
|||||||
elif data['event'] == 'leave':
|
elif data['event'] == 'leave':
|
||||||
location = STATE_NOT_HOME
|
location = STATE_NOT_HOME
|
||||||
else:
|
else:
|
||||||
logging.getLogger(__name__).error('Misformatted mqtt msgs, _type=transition, event=%s',
|
logging.getLogger(__name__).error(
|
||||||
|
'Misformatted mqtt msgs, _type=transition, event=%s',
|
||||||
data['event'])
|
data['event'])
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -96,7 +96,6 @@ def setup_scanner(hass, config, see):
|
|||||||
|
|
||||||
see(**kwargs)
|
see(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
use_events = config.get(CONF_TRANSITION_EVENTS)
|
use_events = config.get(CONF_TRANSITION_EVENTS)
|
||||||
|
|
||||||
if use_events:
|
if use_events:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user