<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_monitor(self, monitor):
 """Set the monitor config. This module assumes that users will connect to the roaster and get reading information _before_ they want to begin collecting roast details. This method is critical to enabling the collection of roast information and ensuring it gets saved in memory. :param monitor: Value to set the monitor :type monitor: bool :returns: None :raises: InvalidInput """

        if type(monitor) != bool:
            raise InvalidInput("Monitor value must be bool")
        self._roast['record'] = bool2int(monitor)
        self._q.put(self._config)

        if self._roast['record']:
            self._roast_start = now_time(str=True)
            self._roast['start_time'] = self._roast_start
        else:
            self._roast_end = now_time(str=True)
            self._roast['end_time'] = self._roast_end
            self._roast['date'] = now_date(str=True)
            et = load_time(self._roast['end_time'])
            st = load_time(self._roast['start_time'])
            self._roast['duration'] = timedelta2period(et - st)
        return self.get_roast_properties()