<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_watering_time(self, zoneid, value):
 """Private method to set watering_time per zone."""

        if value not in MANUAL_WATERING_ALLOWED:
            raise ValueError(
                'Valid options are: {}'.format(
                    ', '.join(map(str, MANUAL_WATERING_ALLOWED)))
            )

        if isinstance(value, int) and value == 0:
            value = 'OFF'
        elif isinstance(value, str):
            value = value.upper()
            if value == 'ON':
                value = MAX_WATERING_MINUTES

        ddata = self.preupdate()
        attr = 'zone{}_select_manual_mode'.format(zoneid)
        ddata[attr] = value
        self.submit_action(ddata)