The index `hardware` does not exist

Hello,

I’m trying to follow the tutorial on onewire with the IMP here and have copied this code from this page exactly:
https://electricimp.com/docs/resources/onewire/

Once I run the code, I get the following error:

2015-09-27 15:31:08 UTC-4	[Device]	Agent restarted: after delay.
2015-09-27 15:31:08 UTC-4	[Device]	Agent started.
2015-09-27 15:31:08 UTC-4	[Agent]	ERROR: the index 'hardware' does not exist
2015-09-27 15:31:08 UTC-4	[Agent]	ERROR:   at main:83

Any idea what is wrong?

You’ve copied the code into the agent pane instead of the device pane of the IDE. The hardware object only exists on the device.