An unusual partnership with LG will help power Apple’s push into smart home devices.