'Initialize the sensor.'

def __init__(self, hass, name, api_key, origin, destination, options):

    self._hass = hass
    self._name = name
    self._options = options
    self._unit_of_measurement = 'min'
    self._matrix = None
    self.valid_api_connection = True
    if (origin.split('.', 1)[0] in TRACKABLE_DOMAINS):
        self._origin_entity_id = origin
    else:
        self._origin = origin
    if (destination.split('.', 1)[0] in TRACKABLE_DOMAINS):
        self._destination_entity_id = destination
    else:
        self._destination = destination
    import googlemaps
    self._client = googlemaps.Client(api_key, timeout=10)
    try:
        self.update()
    except googlemaps.exceptions.ApiError as exp:
        _LOGGER.error(exp)
        self.valid_api_connection = False
        return
