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