<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, section, val, data):
 """Add a setting to the config, but if same as default or None then no action. This saves the .save writing the defaults `section` (mandatory) (string) the section name in the config E.g. `"agent"` `val` (mandatory) (string) the section name in the config E.g. `"host"` `data` (mandatory) (as appropriate) the new value for the `val` """

        k = self.get(section, val)
        # logger.debug('update %s %s from: %s to: %s', section, val, k, data)
        if data is not None and k != data:
            self.set(section, val, data)