def unlock(hass, entity_id=None, code=None):
    'Unlock all or specified locks.'
    data = {}
    if code:
        data[ATTR_CODE] = code
    if entity_id:
        data[ATTR_ENTITY_ID] = entity_id
    hass.services.call(DOMAIN, SERVICE_UNLOCK, data)
Unlock all or specified locks.
def unlock(hass, entity_id=None, code=None):
    
    data = {}
    if code:
        data[ATTR_CODE] = code
    if entity_id:
        data[ATTR_ENTITY_ID] = entity_id
    hass.services.call(DOMAIN, SERVICE_UNLOCK, data)