<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_auto_watering(self, zoneid, value):
 """Private method to set auto_watering program."""

        if not isinstance(value, bool):
            return None

        ddata = self.preupdate()
        attr = 'zone{}_program_toggle'.format(zoneid)
        try:
            if not value:
                ddata.pop(attr)
            else:
                ddata[attr] = 'on'
        except KeyError:
            pass
        self.submit_action(ddata)
        return True