The internet of things, from toys to web cameras, should be more secure, the proposed legislation says.