From b3afb386b70dbe1c98e9a0d5c34dcfe488c8f2f5 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Mon, 23 May 2016 13:48:47 -0700 Subject: [PATCH] If no departure time is set, use now as the default. If departure time is set but does not have a :, assume its a preformed Unix timestamp and send along as raw input. Assume same for arrival_time. --- homeassistant/components/sensor/google_travel_time.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/sensor/google_travel_time.py b/homeassistant/components/sensor/google_travel_time.py index b8513fa9bb6..a2f5e317aec 100644 --- a/homeassistant/components/sensor/google_travel_time.py +++ b/homeassistant/components/sensor/google_travel_time.py @@ -175,9 +175,15 @@ class GoogleTravelTimeSensor(Entity): atime = options_copy.get('arrival_time') if dtime is not None and ':' in dtime: options_copy['departure_time'] = convert_time_to_utc(dtime) + elif dtime is not None: + options_copy['departure_time'] = dtime + else: + options_copy['departure_time'] = 'now' if atime is not None and ':' in atime: options_copy['arrival_time'] = convert_time_to_utc(atime) + elif atime is not None: + options_copy['arrival_time'] = atime self._matrix = self._client.distance_matrix(self._origin, self._destination,