My dryer is electric. I pondered how to best do this for days on end. My dryer is 2 feet from my electrical panel and it's an older house so I needed to replace the 240V outlet anyway, so I had a number of options. But because it's an old house and I have some electrical and plumbing projects planned, I didn't want to risk doing something that wouldn't be code compliant and cause problems down the road.
I couldn't figure out a good way to hardwire the HDSS that would be code compliant, so I cheated. I got a few feet of 10-gauge 4-conductor flexible cable from Lowe's, and ran that from the dryer to the smart switch (It fit perfectly in the gasket on the switch, and I put terminal connectors on the cable to make it more secure on both ends), then I wired the dryer plug to the smart switch. Basically, I made the switch part of the appliance rather than part of the house. I think that should be legit. The one thing I did do for good measure was secure the switch to the wall rather than to the dryer - didn't want the vibration to cause any problems.