<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _write_config(self):
 """Write the value to the config register in the device """

        normal_flag = False
        if self._mode == MODE_NORMAL:
            #Writes to the config register may be ignored while in Normal mode
            normal_flag = True
            self.mode = MODE_SLEEP #So we switch to Sleep mode first
        self._write_register_byte(_BME280_REGISTER_CONFIG, self._config)
        if normal_flag:
            self.mode = MODE_NORMAL