Nest generated about $340 million in sales last year, according to three people with knowledge of the matter. That’s an impressive figure for a company in the very nascent market of Internet-connected devices.