From 07bb64815d3a1d20fe344bd8b909738ef12a4d7d Mon Sep 17 00:00:00 2001 From: David Straub Date: Tue, 11 Apr 2017 13:55:42 +0200 Subject: [PATCH] Missing line name restriction added (fixes #7039) (#7040) --- homeassistant/components/sensor/mvglive.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/sensor/mvglive.py b/homeassistant/components/sensor/mvglive.py index 7043da53222..b8bab2a6b5d 100644 --- a/homeassistant/components/sensor/mvglive.py +++ b/homeassistant/components/sensor/mvglive.py @@ -143,6 +143,9 @@ class MVGLiveData(object): # find the first departure meeting the criteria if not _departure['destination'].startswith(self._destination): continue + elif (self._line is not None + and _departure['linename'] != self._line): + continue elif _departure['time'] < self._offset: continue # now select the relevant data