def METHOD_NAME(self, portname, state):
    port_idx = self._port_name_to_index(portname)
    ledMode = self._port_state_to_mode(port_idx, state)
    with open(self.f_led.format("port{}".format(port_idx)), 'r') as led_file:
        saveMode = int(led_file.read())
    if ledMode == saveMode:
        return
    self._port_led_mode_update(port_idx, ledMode)
    DBG_PRINT("update {} led mode from {} to {}".format(portname, saveMode, ledMode))